Rotate
Returns a collection of pages that vary along the specified dimension while sharing the current page’s values for the other dimensions, including the current page, sorted by the dimension’s default sort order.
- Syntax
- PAGE.Rotate DIMENSION
- Returns
- page.Pages
Usage
The Rotate method on a Page object returns a collection of pages that vary along the specified dimension of the multidimensional content model, while holding the other dimensions constant. The result includes the current page and is sorted according to the rules of the specified dimension. For example, rotating along language returns all language variants that share the current page’s version and role. The collection includes only the sites that the page is published to.
Hugo sorts the collection using these rules:
| Dimension | Primary sort | Secondary sort |
|---|---|---|
| Language | Weight ascending | Lexicographical ascending |
| Version | Weight ascending | Semantic version descending |
| Role | Weight ascending | Lexicographical ascending |
Arguments
DIMENSION- (
string) The dimension to rotate along, one oflanguage,version, orrole.
Examples
{{/* Returns languages sorted by weight ascending, then lexicographically ascending */}}
{{ range .Rotate "language" }}
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
{{ end }}Rotating along the version dimension:
{{/* Returns versions sorted by weight ascending, then semantic version descending */}}
{{ range .Rotate "version" }}
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
{{ end }}Rotating along the role dimension:
{{/* Returns roles sorted by weight ascending, then lexicographically ascending */}}
{{ range .Rotate "role" }}
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
{{ end }}Last updated:
November 20, 2026
:
content: Document the multidimensional content model (88263ddf4)
Improve this page