Ok, I have a website with a defined layout and all working well.
My website includes pages like /en/about/
and is using the main predefined layout.
Now, I would like to do a completely new layout for a single page which will be located under /en/about/promo/
It will be like a New page inside the Current page. It will have its own meta tags in the header, individual style, etc.
But, the thing TOTALLY different will be, that it will use all individual parts of the layout, NOTHING (with some exceptions like render-image etc.) will be reused from the main layout, which means that it will have its own HEAD, BODY, AND FOOTER and this will be identified through parameter specified in frontmatter, something like that.
---
individual: true
---
Standard lookup order for hugo is
βββ _default
β βββ baseof.html
β βββ list.html
β βββ single.html
βββ index.html
ref: Template lookup order | Hugo
On my website I am not using baseof.html
but else is like on the above.
I could introduce baseof.html
and through IF statement get this working in theory:
{{ if .Params.individual }}
<!-- here will be reference to NEW individual layout -->
{{ partial "individual-head.html" . }}
<body>
<div>
{{ partial "individual-content.html" . }}
</div>
{{partial "individual-footer.html" .}}
</body>
</html>
{{ else }}
<!-- here will go back to default hugo lookup order base on what type of page, taxonomy etc it is. -->
{{ end }}
Where first part is theoretically sorted, how to tell Hugo to do the default lookup order, which is LIST, SINGLE or INDEX from the above?