hugo/content/en/variables/pages.md
Bjørn Erik Pedersen 5070ba6c9e Squashed 'docs/' changes from fdea5430f..0584815c8
0584815c8 Add a page about Pages methods (Next, Prev)
653dc8db5 Add note about default bgColor

git-subtree-dir: docs
git-subtree-split: 0584815c8a9ef49c9682b6468a9f2a1e9f05be46
2019-10-21 10:49:16 +02:00

1.1 KiB

title linktitle description date categories keywords draft menu weight sections_weight aliases toc
Pages Methods Pages is the core page collection in Hugo and has many useful methods. 2019-10-20
variables and params
pages
false
docs
title parent weight
methods defined on a page collection variables 21
21 20
/pages
true

Also see List templates for an overview of sort methods.

.Next PAGE

.Next and .Prev on Pages work similar to the methods with the same names on .Page, but are more flexible (and slightly slower) as they can be used on any page collection.

.Next points up to the next page relative to the page sent in as the argument. Example: {{with .Site.RegularPages.Next . }}{{.RelPermalink}}{{end}}. Calling .Next with the first page in the collection returns nil.

.Prev PAGE

.Prev points down to the previous page relative to the page sent in as the argument. Example: {{with .Site.RegularPages.Prev . }}{{.RelPermalink}}{{end}}. Calling .Prev with the last page in the collection returns nil.