Skip to content

Commit

Permalink
Update collections.Sort
Browse files Browse the repository at this point in the history
  • Loading branch information
jmooring committed Dec 23, 2023
1 parent 4b8f6b9 commit f7c6414
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions content/en/functions/collections/Sort.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}}
Expand Down

0 comments on commit f7c6414

Please sign in to comment.