Hi, I’m new to Hugo, I’m using the hello friend template and I’m not sure how can change the logo for the entire site.
On hello-friend/layouts/partials/logo.html
<a
href="{{ if $.Site.Params.Logo.LogoHomeLink }}{{ $.Site.Params.Logo.LogoHomeLink }}{{ else }}{{ $.Site.BaseURL }}{{ end }}"
class="logo"
style="text-decoration: none;"
>
{{ if $.Site.Params.Logo.path }}
<img src="{{ $.Site.Params.Logo.path }}" alt="{{ $.Site.Params.Logo.alt }}" />
{{ else }}
<span class="logo__mark">{{ partial "greater-icon.html" . }}</span>
<span class="logo__text"
>{{ with $.Site.Params.Logo.logoText }}{{ . }}{{ else }}hello friend{{ end }}</span
>
<span class="logo__cursor"></span>
{{ end }}
</a>
I tried to change .Site.Params.Logo.path inside the config.toml
file like this:
[params]
Author = "Gers2017"
# OS theme is default when not provided, but you can force it to "light" or "dark"
defaultTheme = "dark"
# Show reading time in minutes for posts
showReadingTime = false
[params.logo]
path = "hello.png" # inside: ./static/hello.png
alt = "Hello Logo"
The above works on the home page but not for any of the posts. (Posts try to load the image from “http://localhost:1313/posts/my-first-post/hello.png”)