I don’t much fancy this - my theme is being geared up for a CMS style editor, it’s seems a shame to have a single edge case whereby I’m reading and writing two files instead of just the one. It would come with added complications when having to respect existing config.toml values instead of (as I currently do) just overwriting the entire frontMatter section.
I’ll see if I can abuse the permalink system; create an archetype for the homepage and do something like this:
So, my solution was along the same lines as the hugoskeletonsite theme whereby the homepage ranges through the content and uses whichever page is tagged with “homepage”.
<!--
This homepage simply outputs the first content page with
a frontMatter type="homepage". It should be identical to
the "page" template when rendered.
-->
{{- range first 1 (where .Data.Pages "Type" "homepage") -}}
{{ partial "head.html" . }}
<article>
{{ .Content }}
</article>
{{ partial "foot.html" . }}
{{ end }}
Whereby the partials must be careful to not use .File vars as these are only available to Pages, but not Nodes like the homepage.