redOctober13
redOctober13

Reputation: 3974

How to use a favicon with ember-cli?

I had a favicon working for a while on my index template, but not any any other template, and now even my index template won't show it.

I'm just in development, so I'm using ember server.

index.html
<link rel="icon" href="favicon.ico">

Just throwing around my favicon to see if it shows up anywhere, I now have it in the following locations: app/ public/ public/assets

I think this should be very straightforward, especially since the index page doesn't change, just get's new stuff loaded into its outlets, so I can't figure out why it can't find my favicon file.

When running ember server, where actually is the / root pointing to?

Upvotes: 12

Views: 8000

Answers (2)

Dhaulagiri
Dhaulagiri

Reputation: 3291

If you keep the favicon file in public/assets/ you can reference it like this:

<link rel="icon" href="/assets/favicon.ico">

The Ember CLI docs have a good section on this

Upvotes: 27

Dave W.
Dave W.

Reputation: 1596

You could also check out ember-cli-favicon.

It's an addon that takes your source public/favicon.png and automatically outputs all the different favicon formats and sizes for different devices, as well as injects the appropriate HTML into your index.html file as part of the build process.

Upvotes: 7

Related Questions