How to Render Child Pages in a Custom Hugo Section (Ananke Theme) #888
Unanswered
s4ler
asked this question in
2 - Q&A / Support
Replies: 2 comments
|
This is for the latest template system only (v0.146+) All pages use Everything in a subfolder without underscore in the beginning under layouts defines the layout for a specific section. So if your content is in Everything inside the |
0 replies
|
Hi Patrick:
Wow! That was succinctly put and solved, not this problem, but all future site structure issues.
Much appreciated!
Scott
Sent from Yahoo Mail for iPad
On Tuesday, December 9, 2025, 11:18 PM, Patrick Kollitsch ***@***.***> wrote:
This is for the latest template system only (v0.146+)
All pages use baseof.html as outer skeleton layout.
Everything in a subfolder without underscore in the beginning under layouts defines the layout for a specific section. So if your content is in content/honey then those pages are rendered via layout/honey/*.html. Copy the file layouts/single.html and layouts/list.html to layouts/sectionname/ and change everything between {{ define "main" }} and {{ end }} to change the layout for that specific section.
Everything inside the {{ define "main" }} section in those templates is rendered inside the {{ block "main" . }}{{ end }} in baseof.html (line 64 currently).
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I’m using Hugo + Ananke with a custom section types-of-honey, and nested sections like types-of-honey/honeydew-forest/ that contain leaf pages (index.md).
I want each hub (e.g. /types-of-honey/honeydew-forest/) to show a list of its child pages as cards. My content structure is:
content/
types-of-honey/
_index.md
honeydew-forest/
_index.md
willow-honeydew/index.md
spruce-honeydew/index.md
What’s the recommended way in Ananke to:
• Define a custom list.html (e.g. under layouts/types-of-honey/list.html or similar), and
• Loop over .Pages to render child pages,
while still inheriting Ananke’s base layout styles?
A tiny working example would be ideal.
Help greatly appreciated. Let me know if I can clarify.
Thanks,
Scott
All reactions