Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 917
redOctober13 Avatar asked Sep 03 '14 16:09

redOctober13


2 Answers

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.

like image 162
Dave W. Avatar answered Nov 20 '22 06:11

Dave W.


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

like image 38
Dhaulagiri Avatar answered Nov 20 '22 07:11

Dhaulagiri