OK! Here is a weird fix. If I put a call .Content at the top, I can get the RenderHooks to work for all the Frontmatter Markdown strings below.
Here’s and example:
<div>{{ .Content }}</div>
<div>{{ .text | $.Page.RenderString }}</div>
This will make the RenderHook work for both outputs.
However, in this arrangement, the RenderHook wont be applied to .text, but it will for .Content
<div>{{ .text | $.Page.RenderString }}</div>
<div>{{ .Content }}</div>
And as we know, just piping .text through $.Page.RenderString without .Content being called prior, wont cause the RenderHooks to fire.
<div>{{ .text | $.Page.RenderString }}</div>
I’m sure it makes since to the Hugo dev team. I’m sure that this function was conceived for use with .Contnet because that’s were the content is! However, when making a site for a client, we want to make the layout on the page modular. We want them to be able to move the parts around. Forestry allows us to do this with what they call “Blocks.” This allows us to have multiple content sections on the page. For example, consider this layout: Navigation, Featured Image, Into Paragraph, Image Gallery, and then a Final paragraph in the footer. In this scenario, there are 2 text based content areas, not just one main one.
This is why figuring this out is important. It let’s us leverage the power for Hugo and Forestry to make awesome websites without WordPress.
So, currently, in my html templates, I include a call to .Content(even though the content area is empty) in order to get the RenderHooks to fire. It’s a hack. But it works. I’m not sure if this is a race condition or an order of operations issue. I’m might be apply this incorrectly too. Regardless Hugo still fucking rocks!
Please advise.