This is a weird thing and I am pretty sure I overlook something small…
My website has a section documentation
. I want to hide the documentation from the live site, so I moved it out of the content
folder and then mounted it in its old place. Starting then Hugo stopped acknowledging the “posttype” of those documentation pages.
“posttype”: I have a system implemented where in data/.../theme.toml
I have sections like this:
[types.documentation]
related = false
comments = false
banner = false
headline = false
bannerheadline = true
meta = false
transform = ["headline", "content", "preview"]
that configures how posts are shown in sections (features, order, etc.). My “posttype” is currently the name of the section (first level of the URL after the domain name).
Before moving the documentation folder out of the content folder, the website worked fine but showed the documentation. My idea is to have a mount via config/development/modules.toml
so it’s not shown or included in live site page collections.
- Branch 1: documentation is inside of content - all works well
- Branch 2: documentation is outside of content and mounted via module.toml - error
- Commit with the changes between these two branches
The error is this:
Error: error building site: render: failed to render pages:
render of "page" failed:
"/home/patrick/github.com/davidsneighbour/hugo-modules/modules/errors/layouts/error/single.html:8:21":
execute of template failed: template: error/single.html:8:21:
executing "main" at <partials.Include>: error calling Include:
"/home/patrick/github.com/davidsneighbour/kollitsch.dev/layouts/partials/content/post.html:63:11":
execute of template failed: template: partials/content/post.html:63:11:
executing "partials/content/post.html" at <partial "content/components/meta.html" $post>:
error calling partial:
"/home/patrick/github.com/davidsneighbour/kollitsch.dev/layouts/partials/content/components/meta.html:4:18":
execute of template failed: template: partials/content/components/meta.html:4:18:
executing "partials/content/components/meta.html" at <partialCached "func/getPostSetup.html" $posttype>:
error calling partialCached:
"/home/patrick/github.com/davidsneighbour/kollitsch.dev/layouts/partials/func/getPostSetup.html:6:10":
execute of template failed: template: partials/func/getPostSetup.html:6:10:
executing "partials/func/getPostSetup.html" at <$posttype>:
invalid value; expected string
I added a warn $posttype
immediately before the error occurred, and it seems that Hugo has documentation
as a value. One line later, this fails.
Any suggestion as to where to dig for the reasons of this mess is welcome.
Could it be connected to my older issue of templates.Exists not working for mounted folders?