🐞 Bug: Favicon is not loading in Hugo site with Toha v4 #1056
-
Hugo version: 📄 DescriptionI’m trying to set a favicon for my Toha-based Hugo site, but it doesn’t load in the browser. The favicon path seems correct, but I keep getting a I have the favicon placed in 📂 Project structure
🛠 Configurationhugo.yaml params:
logo:
main: "/images/logo.png"
favicon: "/images/favicon.png" layouts/partials/header.html <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
{{ partial "helpers/style-bundle.html" . }}
<!--================= favicon =========================-->
{{ if site.Params.logo.favicon }}
<link rel="icon" type="image/png" href="{{ with .Site.Params.logo.favicon }}{{ . | relURL }}{{ else }}/favicon.png{{ end }}">
{{ else }}
<link rel="icon" href="/assets/images/favicon.ico" type="image/x-icon"/>
{{ end }}
{{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink site.Title | safeHTML }}
{{ end }} 🔍 What I tried
🧑💻 Expected behaviorThe favicon should load in the browser tab from ❓ Question
✅ Steps to reproduce
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Please, put it in the |
Beta Was this translation helpful? Give feedback.
Please, put it in the
assets
dir.