HUGO
Menu
GitHub 87548 stars Mastodon

PageGroups

返回當前分頁器中的頁面分組。

Syntax

PAGER.PageGroups

Returns

page.PagesGroup

PageGroups 方法與任何 分組方法 一起使用。

{{ $pages := where site.RegularPages "Type" "posts" }}
{{ $paginator := .Paginate ($pages.GroupByDate "Jan 2006") }}

{{ range $paginator.PageGroups }}
  <h2>{{ .Key }}</h2>
  {{ range .Pages }}
    <h3><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h3>
  {{ end }}
{{ end }}

{{ partial "pagination.html" . }}

Last updated: January 1, 0001
Improve this page