Sections
返回顶层 section 页面的集合。
Site 对象上的 Sections 方法按默认排序返回顶层 section 页面的集合。
给定如下内容结构:
content/
├── books/
│ ├── book-1.md
│ └── book-2.md
├── films/
│ ├── film-1.md
│ └── film-2.md
└── _index.md这个模板:
{{ range .Site.Sections }}
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
{{ end }}渲染结果为:
<h2><a href="/books/">Books</a></h2>
<h2><a href="/films/">Films</a></h2>