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