mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
Merge commit '35dec7c96f7ee3eb17dd444f7067f0c776fb56ae'
This commit is contained in:
24
docs/content/en/methods/pages/ByLength.md
Normal file
24
docs/content/en/methods/pages/ByLength.md
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
title: ByLength
|
||||
description: Returns the given page collection sorted by content length in ascending order.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related: []
|
||||
returnType: page.Pages
|
||||
signatures: [PAGES.ByLength]
|
||||
---
|
||||
|
||||
```go-html-template
|
||||
{{ range .Pages.ByLength }}
|
||||
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
|
||||
{{ end }}
|
||||
```
|
||||
|
||||
To sort in descending order:
|
||||
|
||||
```go-html-template
|
||||
{{ range .Pages.ByLength.Reverse }}
|
||||
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
|
||||
{{ end }}
|
||||
```
|
Reference in New Issue
Block a user