HUGO
Menu
GitHub 87548 stars Mastodon

ByExpiryDate

返回給定頁面集合按過期日期升序排序。

Syntax

PAGES.ByExpiryDate

Returns

page.Pages

按過期日期排序時,值由您的 站點配置 確定,默認為 front matter 中的 expiryDate 字段。

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

要按降序排序:

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

Last updated: January 1, 0001
Improve this page