1

I'm using a theme ( https://github.com/frjo/hugo-theme-zen ) which in it's baseof.html has {{- block "head" . }}{{ end }} and this block is not defined in any layout. Now I want to extend the theme by adding content in the head block.

My initial attempt has been to add a new file layouts/_default/list.html to my project which defines the block, however it seems like I override the themes whole list layout ( https://github.com/frjo/hugo-theme-zen/blob/main/layouts/_default/list.html ) instead of only the 'head' block.

How can I add custom html content to the block 'head' in this theme without modifying the code of the theme itself?

Octetz
  • 159
  • 8
  • You should ask the Theme maintainer. if your data is accurate in your question (I have no reason to doubt it) then the issue you are running into is the result. – Rogelio Mar 31 '23 at 02:36

1 Answers1

2

Yes, you need to add/override a template that extends "baseof.html" to use {{- block "head" . }}{{ end }}.

I added the "head" block to make it possible to add things to "" without needing to override "baseof.html".

frjo
  • 56
  • 5