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:
weight
(ascending)date
(descending)linkTitle
falling back totitle
(ascending)- logical path (ascending)
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 }}
Last updated:
March 5, 2025
:
content: Remove "related" array from function and method pages (2fcd21ee5)
Improve this page