I wanted to load a partial in my footer on all pages except the home page so in footer.html
I did:
{{ if not .IsHome }}
{{ partial "footer-top.html" . }}
{{ end }}
Worked fine on localhost. After deploying to Netlify, footer-top.html
shows up on the home page.
I changed BaseURL in hugo.toml
from /
to Netlify’s provided URL – didn’t work.
Noticed that in my netlify.toml
Go version is a bit behind my local version. Updated – didn’t work.
Checked the logs on Netlify – looked fine (to me).
Deployed to a different service – same problem, so it’s not Netlify.
Tried printing:
<div>Current page URL: {{ .URL }}</div>
or
<div>Current page Permalink: {{ .Permalink }}</div>
Which returned nothing (both on local and remote server). BTW .URL
returned an error on internal page but not on the home page.
At this point I thought I’d run a conditional on the front matter instead of IsHome
. In _index.md
(content/english
) I added:
hideFooterTop: true
and in my footer.html
:
{{ if not .Params.hideFooterTop }}
{{ partial "footer-top.html" . }}
{{ end }}
This, again, worked on the localhost but not when deployed to a remote host.
Any idea what is going on?