Using Create a Website how can I add a favicon?


#1

When I use the Start a New Project > Create a Website option I get a project where I can create new text files, etc.

If I try and drag in a favicon.ico file it gets moved to the assets folder and does not end up at the right url. How can I add a favicon.ico to a Create a Website style project?


#2

The w3c’s preferred way of adding a favicon is to use <link rel="shortcut icon" href="%URL_TO_FILE%"> in the head of your page, which allows the favicon to be placed anywhere, rather than at the root of the current domain. So you can use the favicon in the assets folder with that method.


#3

Good point!

I went with rel=“icon” instead of link rel=“shortcut icon” because that seems to be the recommended on MDN: https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types

Thanks!