I am having a footer where I write something about me. That footer appears on each page. I put the content of the footer in a markdown file in the folder sitewide and add headless: true
to the front matter.
Then I load the content via the following snippet:
{{ with .Site.GetPage "page" "sitewide/authorfooter.md" }}
<div id="authorfooter">
<h3>{{ .Title }}</h3>
{{ .Content }}
</div>
{{ end }}
I found that very clever, until it dawned on me, that probably this way leads to Hugo loading x-times that markdown file for x pages (I have about 2000 blogposts). Is there any way to do this via a cached way - but without putting the text for the footer into the theme/layout files?