https://gohugo.io/templates/content/#which-template-will-be-rendered states
Users can specify the
typeandlayoutin the front-matter.
but when I read https://gohugo.io/content/front-matter/, layout isn't listed as a possible variable. Should it? I'm confused. I'm new to Hugo, but when I tried to override layout in my front-matter I wasn't succesful.
Hello @JensRantil,
please ask questions like these on the Hugo forum; GitHub is used for concrete issues and requests/enhancements.
@digitalcraftsman Did some more digging. This issue is a documentation issue. layout should be listed on https://gohugo.io/content/front-matter/. It's not. Please reopen.
I got layout to work after some fiddling. If someone documents layout there, it might be worth mentioning that it's not supposed to refer to a specific layout file, but rather a layout directory. Could also be nice to mention if it can refer to something "mylayout/mysublayout" (which I believe isn't possible).
Thanks for the update and you'r right about the missing option in the documentation. Currently, we're working on a revamped version of the docs (content + design) which you can see here. It lists layout as a possible variable in the front matter.
We try to migrate to this version as soon as possible so I don't know if the current docs will become updated accordingly. Anyway, I'll leave this issue open for now.
Anyway, I'll leave this issue open for now.
Did you forget to reopen the issue?
Yes, I did. Thanks for the note. It's now reopened.
Soon we'll switch to a rewritten version of the docs. This issue was already covered during the rewrite. See https://github.com/rdwatters/hugo-docs-concept/issues/130. Hence this issue can be seen as fixed.