Debian Codegraph @

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

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