How to connect to favicon in ember-cli app?

I want to include an icon in my ember-cli app. I put an .ico

image in /public/assests/img/

and was able to include this image in the page.

According to this question , I am on the right track, but ...

Where would I like the badge? Usually I would put:

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

      

in head

the html file. What file .hbs

should it contain head

? I'm new to ember and ember-cli, but I thought the hbs files were just partial HTML files. I tried throwing the tag link

into a file application.hbs

, but it doesn't work. What am I missing?

+3


source to share


2 answers


I'll just add it to the file app/index.html

right in <head>

. There might be a way to add it to {{content-for 'head'}}

in the application initializer, but I'm not entirely sure of myself.



+5


source


You can use ember-cli-favicon .



This is an addon that takes your source public/favicon.png

and automatically outputs all different favicon formats and sizes for different devices, and injects the appropriate HTML into your file index.html

as part of the build process.

+2


source







All Articles