Where do I put my favicon with Hugo

前端 未结 3 883
时光说笑
时光说笑 2021-02-04 23:55

I am using Hugo to generate a static site. Where should I put my favicon.ico file?

相关标签:
3条回答
  • 2021-02-05 00:11

    Static files (like logo image or favicon) goes to the "static" folder If you are using:

    • a downloaded template, put it in /static/* of your hugo project (to avoid getting erased when updating it)
    • your own tempalte, put it in /themes/themeName/static/*

    Both will be accessible with path like: /*

    Example : "/static/ico/myico.ico" and "/themes/themeName/static/ico/myico.ico" will be bot accessible by "/ico/myico.ico"

    0 讨论(0)
  • 2021-02-05 00:30

    Putting your favicons in static folder is right. It will be published to public folder once the page is built.

    However, using absolute CDN (e.g.: Dropbox) services could be better for page performance.

    0 讨论(0)
  • 2021-02-05 00:32

    Put the favicon inside of the static directory. The static directory sits in the root of your hugo site. When you generate your site, the favicon will be copied into public, the root of the generated site.

    0 讨论(0)
提交回复
热议问题