HUGO
Menu
GitHub 87548 stars Mastodon

ByDate

返回给定页面集合按日期升序排序。

Syntax

PAGES.ByDate

Returns

page.Pages

按日期排序时,值由您的 站点配置 确定,默认为 front matter 中的 date 字段。

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

要按降序排序:

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

Last updated: January 1, 0001
Improve this page