如何使用 Meteor 加载网站图标 [英] How to load a favicon with Meteor
问题描述
我想弄清楚如何向我的流星应用程序添加收藏夹图标.根据文档,我应该把它放在 /public
目录中,但没有比这更多的信息了.我把我的 favicon.ico
文件放在那里并在我的 html 文件的标题中引用它,但浏览器没有加载它.如果我在 chrome 上打开开发工具,它会显示文件加载(即,转到 localhost:3000/favicon.ico
).有人对我可能遗漏的内容有任何建议吗?
I'm trying to figure out how to add a favicon to my meteor app. Per the docs I should put it in the /public
directory, but there isn't really much more info than that. I put my favicon.ico
file there and referenced it in the header of my html file, but the browser doesn't load it. If I open up the dev tools on chrome though, it shows the file loading (i.e., go to localhost:3000/favicon.ico
). Anyone have any suggestions on what I might be missing?
推荐答案
它应该可以工作.可能是路径问题或本地主机上的缓存.
It should work. Probably either an issue with the path or caching on localhost.
以下是链接收藏夹图标的方式:
Here's how the favicon should be linked:
<link rel="icon" sizes="16x16 32x32" href="/favicon.ico?v=2">
(注意:开头的/
,很重要!)
(Note: the /
in the beginning; its important!)
这篇关于如何使用 Meteor 加载网站图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!