Pass a block's value to a partial from baseof?

If I’m inside baseof.html and I have a block meta that’s being overridden (defined) in the current page template, e.g. single.html. What is the correct way to pass that block’s value to a partial (so that I can access or emit that block from the partial, not from baseof)?

Have you tried defining your block directly inside your partial?

Tried that but it didn’t work for me; maybe I’m doing something wrong.

See this post about including a value from the .GitInfo hash (which is only available in _default/single) and emitting that value in a meta tag within partials/head.html. Works in _default/baseof, but it’s blank within the partial.

I see. Try it this way instead, in your _default/single.html

{{ define "meta" }}
  {{ partial "some_partial.html" . }}
{{ end }}
1 Like

Hm. That’s a less than ideal solution only because I’m trying to follow clean templating process by using a default baseof where most of the partials are being invoked. What I’m looking for is a block / yield that would work from single THROUGH baseof to the partial.