I'm trying to load a favicon into my Meteor project but I can't get it to work. I tried using this tutorial but when I put the mentioned reference in the of my HTML nothing happened. Also what do they mean by /public directory? I don't have a /public directory, should I just put my favicon.ico in the root directory?
The public
directory doesn't exist by default - you just need to create it. Meteor uses the public
directory in the root of your app to serve plain files rather than bundling them in the app. In order for a <link rel="icon">
tag to work, it needs to point to a file that exists in public
. Note that the URL to the icon will not contain the path "public/"
- files in public
are served as if they were at the root of your web server.
A new Meteor app doesn't include any folders except the required .meteor
directory. However, it will treat folders named public
, private
, client
, server
, and lib
specially. You can also create more arbitrarily named directories. This affords you a lot of control over the exact structure of your app. Read about the Meteor directory structure in the Documentation:
Lastly, the Meteor server will serve any files under the
public
directory, just like in a Rails or Django project. This is the place for images, favicon.ico, robots.txt, and anything else.
client/header.html
: <head><link rel='icon' href='/favicon.ico'></head>
favicon.ico
into /public
folder.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With