nuxt-rfg-icon icon indicating copy to clipboard operation
nuxt-rfg-icon copied to clipboard

Different favicon for different layout?

Open edwh opened this issue 5 years ago • 5 comments

Hi there - thanks for the code.

I have an app where I have two layouts, and I would like a different favicon for each. Is there a way to do this?

edwh avatar Jun 05 '20 09:06 edwh

Its a bit hacky but you could try to import this module in your nuxt.config, then clone it twice and add both cloned functions as modules. See here for how to clone: https://stackoverflow.com/questions/1833588/javascript-clone-a-function

Never tried this but theoretically it should be possible.

Otherwise you could maybe try to use https://pwa.nuxtjs.org/modules/icon.html

pimlie avatar Jun 07 '20 14:06 pimlie

That is a bit hacky - but not something I'd thought of, so I might try that. Thank you.

------ Original Message ------ From: "Pim" [email protected] To: "pimlie/nuxt-rfg-icon" [email protected] Cc: "Edward Hibbert" [email protected]; "Author" [email protected] Sent: 07/06/2020 15:21:03 Subject: Re: [pimlie/nuxt-rfg-icon] Different favicon for different layout? (#16)

Its a bit hacky but you could try to import this module in your nuxt.config, then clone it twice and add both cloned functions as modules. See here for how to clone: https://stackoverflow.com/questions/1833588/javascript-clone-a-function

Never tried this but theoretically it should be possible.

Otherwise you could maybe try to use https://pwa.nuxtjs.org/modules/icon.html

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pimlie/nuxt-rfg-icon/issues/16#issuecomment-640226137, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAN26GC23ASVZ7AJ5GXCZTRVOO47ANCNFSM4NTMCPPA.

edwh avatar Jun 08 '20 15:06 edwh

I'm facing a similar problem (maybe also more complex) and couldn't find a solution with @nuxtjs/pwa.

I'm creating a multi-tenancy app based on different subdomains proxied to the same Nuxt app. To be more clear: I'm using the same Nuxt project for N subdomains so customers will be able to create as many subdomains they want, I can't have a fixed folder structure to serve different files for each tenant.

Customers will also have an admin to customize many things in the app for their our subdomain. And among other things, the favicon, manifest and meta tags are also a requisite. Is there any way to programmatically use this package to generate favicons on the fly (not on build time)?

ErickPetru avatar Oct 16 '20 20:10 ErickPetru

I'm facing a similar problem (maybe also more complex) and couldn't find a solution with @nuxtjs/pwa.

I'm creating a multi-tenancy app based on different subdomains proxied to the same Nuxt app. To be more clear: I'm using the same Nuxt project for N subdomains so customers will be able to create as many subdomains they want, I can't have a fixed folder structure to serve different files for each tenant.

Customers will also have an admin to customize many things in the app for their our subdomain. And among other things, the favicon, manifest and meta tags are also a requisite. Is there any way to programmatically use this package to generate favicons on the fly (not on build time)?

Hey @ErickPetru. Did you solve it? I'm having the same issue.

DerOrangeBaron avatar Mar 31 '21 18:03 DerOrangeBaron

Hello @DerOrangeBaron, the solution was not possible with this package or any other Nuxt package.

We had to move to a dynamic asset generation approach from the backend. The frontend just uses basic URLs for icons, manifest, etc. all pointing to a backend endpoint we created that generates the resource on the fly in a personalized way. This is done in the backend by looking at the request referer (this way the backend knows which subdomain requested which assets).

A very complex solution for something that would be really simple if the Nuxt packages were created with multi-tenancy in mind.

ErickPetru avatar Mar 31 '21 19:03 ErickPetru