I have a fairly simple sections structure, according to docs (assume I have the same articles and products):
So my layouts/<type>/section.html is used to render every single section page of that type. My <type> shall be named special.
Trouble is, I want the top-most section rendered differently than the sub-sections - which will be rendered all alike, in fact they will share the same template as a leaf page.
I only mention the above if anyone has a cleaner proposition than what I currently have:
A test in section.html which decides whether this is the top-most section or not and goes for a partial, but I cannot get this work universally:
testing for .Ancestors or .Parent does not seem to work here; and
testing for .File.Path does work, but it is not universal (I have to check for articles and products, not for type), i.e. I cannot use it with type: special later on.
As I would like to re-use this setup, I really would like something more robust than checking for .File.Path. Is it possible?
git clone --single-branch -b hugo-forum-topic-56053 https://github.com/jmooring/hugo-testing hugo-forum-topic-56053
cd hugo-forum-topic-56053
hugo server