hugo/content/en/methods/site/Sections.md
Bjørn Erik Pedersen 9b0050e9aa Squashed 'docs/' content from commit 5c085a37b
git-subtree-dir: docs
git-subtree-split: 5c085a37b297bf12f59efeaae591418ec025c10d
2024-01-27 10:48:33 +01:00

730 B

title description categories keywords action
Sections Returns a collection of first level section pages.
related returnType signatures
methods/site/AllPages
methods/site/Pages
methods/site/RegularPages
page.Pages
SITE.Sections

Given this content structure:

content/
├── books/
│   ├── book-1.md
│   └── book-2.md
├── films/
│   ├── film-1.md
│   └── film-2.md
└── _index.md

This template:

{{ range .Site.Sections }}
  <h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
{{ end }}

Is rendered to:

<h2><a href="/books/">Books</a></h2>
<h2><a href="/films/">Films</a></h2>