Update collections.Sort

This commit is contained in:
Joe Mooring 2023-12-23 13:51:06 -08:00 committed by GitHub
parent 4b8f6b9914
commit f7c64143cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 %}}