Thanks! I got confused (again) with the case-conversion of different params. Also because in the debug output it is lower case.
But unfortunately, .Layout renders into the array of actual template candidates
(The output is something like class="[dir1/foo.html _default/foo.html]")
You are correct, you cannot use Layout for this. Maybe Type – or a customer param?
All methods and attributes on Go objects (Page, Node etc.) start with an upper case character – this is how you export / make stuff public in Go. This is not a restriction in Go maps (.Params is a map).
OK, thanks for pointing that out for me!
I worked around it and went the “type” - path.
In case, someone else has the same problem:
I reorganized my templates from layouts/_default/foo.html to layouts/foo/single.html and use type instead of layout in front matter now. This way I can use .Type in the body - element: