1
0
Fork 0

update pages source

This commit is contained in:
nanxiaobei 2020-01-16 03:24:22 +08:00
parent 35cf31b81f
commit 2b9088cff6

View file

@ -1,18 +1,14 @@
{{ partial "header.html" . }} {{ partial "header.html" . }}
{{ $pctx := . }}
{{ if .IsHome }} {{ if not .IsHome }}
{{ $pctx = .Site }}
{{ else }}
<header class="page-header"> <header class="page-header">
<h1>{{ if eq .Data.Singular "tag" }}{{ .Data.Term }}{{ else }}Posts{{ end }}</h1> <h1>{{ if eq .Data.Singular "tag" }}{{ .Data.Term }}{{ else }}Posts{{ end }}</h1>
</header> </header>
{{ end }} {{ end }}
{{ $paginator := .Paginate (where $pctx.RegularPages "Type" "in" .Site.Params.mainSections) }} {{ $paginator := .Paginate (where .Site.RegularPages ".Params.type" "!=" "page") }}
{{ if gt $paginator.TotalPages 0 }}
{{ range $index, $page := $paginator.Pages }} {{ range $index, $page := $paginator.Pages }}
<article class="{{ if and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0) }}first-entry{{ else }}post-entry{{ end }}"> <article class="{{ if and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0) }}first-entry{{ else }}post-entry{{ end }}">
<header class="entry-header"> <header class="entry-header">
@ -27,7 +23,6 @@
<a class="entry-link" href="{{ .Permalink }}"></a> <a class="entry-link" href="{{ .Permalink }}"></a>
</article> </article>
{{ end }} {{ end }}
{{ end }}
{{ if gt $paginator.TotalPages 1 }} {{ if gt $paginator.TotalPages 1 }}
<footer class="page-footer"> <footer class="page-footer">