You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: 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 weight.
3
+
description: 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.
4
4
categories: []
5
5
keywords: []
6
6
params:
@@ -11,36 +11,45 @@ params:
11
11
12
12
{{< new-in 0.153.0 />}}
13
13
14
-
The `Rotate` method on a `Page` object returns a collection of pages that vary along the specified [dimension](g), while holding the other dimensions constant. The result includes the current page and is sorted by the dimension's weight. For example, rotating along `language` returns all language variants that share the current page's version and role.
14
+
The rotate method on a page object returns a collection of pages that vary along the specified [dimension](g), 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](g) returns all language variants that share the current page's [version](g) and [role](g).
15
15
16
16
The `DIMENSION` argument must be one of `language`, `version`, or `role`.
17
17
18
-
To render a list of all translations of the current page, including the current page:
18
+
## Sort order
19
+
20
+
Use the following rules to understand how Hugo sorts the collection returned by the `Rotate` method.
21
+
22
+
| Dimension | Primary Sort | Secondary Sort |
23
+
| :--- | :--- | :--- |
24
+
| Language | Weight ascending | Lexicographical ascending |
25
+
| Version | Weight ascending | Semantic version descending |
26
+
| Role | Weight ascending | Lexicographical ascending |
27
+
28
+
## Examples
29
+
30
+
To render a list of the current page's language variants, including the current page, while sharing its current version and role:
0 commit comments