Hello there,
I try to build a page that should use the concept of ‘sections’ heavily. But obviously I have not yet got the concept right.
Given have file structure such as:
/content/
/content/_index.md
/content/concerts/01/_index.md
/content/concerts/01/concert1.md
/content/concerts/01/concert2.md
/content/concerts/02/_index.md
/content/concerts/02/concert3.md
/content/concerts/02/concert4.md
Each concertX.md file looks like this:
---
title: concert[X]
---
index.md files are empty for now.
the theme consists of only two files:
themes/test/layouts/_default/baseof.html
:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
{{ block "content" . }}{{ end }}
</body>
</html>
single.html
:
{{ define "content" }}
{{ range .Site.Pages }}
{{ .Section }} - {{ .Name }}<br>
{{end}}
{{ end }}
The expection of the output at localhost/concerts/concert1.html
would be:
concerts -
concerts -
categories - Categories
concerts - Concerts
tags - Tags
01 - concert1
01 - concert2
02 - concert3
02 - concert4
But instead I have:
concerts -
concerts -
categories - Categories
concerts - Concerts
tags - Tags
concerts - concert1
concerts - concert2
concerts - concert3
concerts - concert4
Why do the concert[X]
pages not get their parent folder name as Section
? According to the documentation I would assume that the file /content/concerts/02/_index.md
ensures for example that 02
is a section which would include concert3 and concert4…
hugo version
Hugo Static Site Generator v0.50/extended linux/amd64 BuildDate: unknown