Hi Hugoians.
I have my blocks sets in baseof.html and in a specific section list.html I don’t want the default block’s contents and I don’t want anything to replace it either: I just want nothing. So I thought I might be able to override the default block and exclude the partial it calls by defining an empty block in list.html. But that doesn’t work — a defined empty block doesn’t override the default block.
based.html
<body class=“baseof ma0 {{ with getenv “HUGO_ENV” }} {{ . }}{{ end }} {{ with .IsHome }}home{{ end }}{{ with .IsPage }}page{{ end }}”>
{{ block “env” . }}{{ partialCached “env” . }}{{ end }}
{{ block “header” . }}{{ partialCached “header” . }}{{ end }}
{{ block “usedby” . }}{{ partialCached “usedby” . }}{{ end }}
{{ block “main” . }}{{ end }}
{{ block “footer” . }}{{ partialCached “footer” . }}{{ end }}
{{ block “scripts” . }}{{ partialCached “scripts” . }}{{ end }}
Adding a html comment to the define block does work — nothing is rendered _ but I’m guessing there’s a much better approach to this scenario and if anyone cares to share I’m all ears.
list.html
{{ define “usedby” }}{{ end }} // An empty define doesn’t override the default block
{{ define “usedby” }}[HTML comment here]{{ end }} // Adding a HTML comment does override the default block and displays no content
Thanks.