HUGO
Menu
GitHub 87548 stars Mastodon

ByLength

返回給定頁面集合按內容長度升序排序。

Syntax

PAGES.ByLength

Returns

page.Pages
{{ range .Pages.ByLength }}
  <h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
{{ end }}

要按降序排序:

{{ range .Pages.ByLength.Reverse }}
  <h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
{{ end }}

Last updated: January 1, 0001
Improve this page