I’m starting with Hugo, and the block templates are a nice feature to have, altought I have some questions of something that I might be not understaing well.
I create a .html inside Partials folder that I want to use throughout the whole site. So let’s say I have:
{{ partial “my-new-partial” . }}
I cannot use this inside Content folder? So how can I use this template blocks in the whole site? Thank you!
Yes, that’s what I’ve been doing. But imagine I have a partial that I don’t want in X, Y and Z pages. If I already have on the baseof.html that partial, how can I remove in the X, Y and Z pages?
I see what you’re asking now. Well, there are a few way to do this. For example, say you only wanted to include a partial on pages of type post. In your baseof.html you would do:
{{ if eq .Type "post" }}
{{- partial "some-partial.html" . -}}
{{ end }}