1
0
Fork 0
hugo-paper/layouts/_default/list.html
nanxiaobei f1387bfc37 5.0
2021-08-20 19:21:20 +08:00

33 lines
848 B
HTML

{{ partial "header.html" . }}
{{ if .Title }}
<h1 class="page-title">{{ .Title }}</h1>
{{ end }}
{{ $pages := union .RegularPages .Sections }}
{{ if .IsHome }}
{{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
{{ end }}
{{ $paginator := .Paginate $pages }}
{{ range $index, $page := $paginator.Pages }}
<article class="post-entry">
<h2>{{ .Title }}</h2>
<time>{{ .Date.Format "January 2, 2006" }}</time>
<a href="{{ .Permalink }}"></a>
</article>
{{ end }}
{{ if gt $paginator.TotalPages 1 }}
<nav class="page-nav">
{{ if $paginator.HasPrev }}
<a class="prev" href="{{ $paginator.Prev.URL }}">← {{ i18n "prev_page" }}</a>
{{ end }}
{{ if $paginator.HasNext }}
<a class="next" href="{{ $paginator.Next.URL }}">{{ i18n "next_page" }} →</a>
{{ end }}
</nav>
{{ end }}
{{ partial "footer.html" . }}