mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-15 10:44:41 -04:00
Some minor clarifications of weight sorting
This commit is contained in:
parent
759b967fc8
commit
fcba7dddf6
@ -158,12 +158,14 @@ Hugo uses both `date` and `weight` to order content within taxonomies.
|
||||
|
||||
Each piece of content in Hugo can optionally be assigned a date. It can also be assigned a weight for each taxonomy it is assigned to.
|
||||
|
||||
When iterating over content within taxonomies, the default sort is the same as that used for section and list pages first by weight then by date. This means that if the weights for two pieces of content are the same, then the more recent content will be displayed first.
|
||||
When iterating over content within taxonomies, the default sort is the same as that used for section and list pages: first by weight, then by date. This means that if the weights for two pieces of content are the same, then the more recent content will be displayed first.
|
||||
|
||||
The default weight for any piece of content is 0.
|
||||
|
||||
Weights of zero are treated specially: if two pages have unequal weights, and one of them is zero, then the zero-weighted page will always appear after the other one, regardless of the other's weight. Zero weights should thus be used with care: for example, if both positive and negative weights are used to extend a sequence in both directions, a zero-weighted page will appear not in the middle of the list, but at the end.
|
||||
|
||||
Zero should be interpreted as "does not have a weight", rather than "has a weight of numerical value zero".
|
||||
|
||||
### Assign Weight
|
||||
|
||||
Content can be assigned weight for each taxonomy that it's assigned to.
|
||||
|
Loading…
x
Reference in New Issue
Block a user