henvo
1
For styling purposes I needed a css class that indicates the right kind of page I am currently on.
So in my header.html
partial I wrote:
<body class="{{ .Kind }}">
(...)
Unfortunately this only works on the Home page:
<body class="home">
But on a list and detail page it’s not working:
<body class>
I am using Hugo 0.18.1 - Can someone verify this ‘bug’? Or am I missing something?
bep
2
Every Page
has a Kind
, so I suspect there is something else going one, which is hard to tell without the full source.
henvo
3
Dammit, you were totally right - I forgot to pass the context to the partial on list pages:
{{ partial "header.html" }}
Instead of:
{{ partial "header.html" . }}
So of course .Kind
was not available…