HUGO
News Docs Themes Community GitHub

RegularPages

Returns a collection of all regular pages.

Syntax

SITE.RegularPages

Returns

page.Pages

The RegularPages method on a Site object returns a collection of all regular pages, in the default sort order.

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

The default sort order for page collections, used when no other criteria are set, follows this priority:

  1. weight (ascending)
  2. date (descending)
  3. linkTitle falling back to title (ascending)
  4. logical path (ascending)

default sort order

To change the sort order, use any of the Pages sorting methods. For example:

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