Debian Codegraph @

docs/content/en/methods/pages/ByTitle.md

raw
1 ---
2 title: ByTitle
3 description: Returns the given page collection sorted by title in ascending order.
4 categories: []
5 keywords: []
6 params:
7 functions_and_methods:
8 returnType: page.Pages
9 signatures: [PAGES.ByTitle]
10 ---
11
12 ```go-html-template
13 {{ range .Pages.ByTitle }}
14 <h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
15 {{ end }}
16 ```
17
18 To sort in descending order:
19
20 ```go-html-template
21 {{ range .Pages.ByTitle.Reverse }}
22 <h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
23 {{ end }}
24 ```