Hi,
I’ve put a block in a partial1.html
{{ block "partial1content" }}Default partial content{{ end }}
Then I’ve tried to define the content in a template.
{{ define "partial1content" }}Some other sidebar content{{ end }}
{{ partial "partial1.html" . }}
However it never seems to make it into the partial?
If I plonk the partial template contents into the main template, then it all works as expected.
I am guessing that the scope of the block is restricted to the partial, whereas being in the template it works as expected.
Is there any way to make this work?
What I was trying to achieve is putting a .TableOfContents into a sidebar. I actually want the sidebar to have different content depending on where I am in the site.
(btw if I put .TableOfContents into the partial it doesn’t work)
Thanks!