mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-09 01:04:44 -04:00
Update collections.Sort
This commit is contained in:
parent
4b8f6b9914
commit
f7c64143cf
@ -105,6 +105,40 @@ This produces:
|
||||
Victor Marius Jean
|
||||
```
|
||||
|
||||
### First level key removal
|
||||
|
||||
Hugo removes the first level keys when sorting a map.
|
||||
|
||||
Original map:
|
||||
|
||||
```json
|
||||
{
|
||||
"felix": {
|
||||
"breed": "malicious",
|
||||
"type": "cat"
|
||||
},
|
||||
"spot": {
|
||||
"breed": "boxer",
|
||||
"type": "dog"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
After sorting:
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"breed": "malicious",
|
||||
"type": "cat"
|
||||
},
|
||||
{
|
||||
"breed": "boxer",
|
||||
"type": "dog"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
## Sort a page collection
|
||||
|
||||
{{% note %}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user