HUGO
News Docs Themes Community GitHub

ByTitle

Returns the given page collection sorted by title in ascending order.

Syntax

PAGES.ByTitle

Returns

page.Pages
{{ range .Pages.ByTitle }}
  <h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
{{ end }}

To sort in descending order:

{{ range .Pages.ByTitle.Reverse }}
  <h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
{{ end }}

Last updated: January 1, 0001
Improve this page