mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-10 18:25:28 -04:00
Update collections.Sort
This commit is contained in:
parent
4b8f6b9914
commit
f7c64143cf
@ -105,6 +105,40 @@ This produces:
|
|||||||
Victor Marius Jean
|
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
|
## Sort a page collection
|
||||||
|
|
||||||
{{% note %}}
|
{{% note %}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user