hugo-WonderMod/layouts/_default/list.html

44 lines
1.2 KiB
HTML
Raw Normal View History

2018-01-08 11:28:39 -05:00
{{ partial "header.html" . }}
2019-03-31 08:32:06 -04:00
2018-01-08 11:28:39 -05:00
{{ if not .IsHome }}
2019-03-31 08:32:06 -04:00
<header class="page-header">
2019-04-28 06:23:51 -04:00
<h1>
{{ if eq .Data.Singular "tag" }}{{ .Data.Term }}{{ else }}Posts{{ end }}
</h1>
2018-01-08 11:28:39 -05:00
</header>
{{ end }}
2019-03-31 08:32:06 -04:00
{{ $paginator := .Paginate (where .Pages ".Params.type" "!=" "page") }}
2018-01-08 11:28:39 -05:00
{{ if gt $paginator.TotalPages 0 }}
{{ range $index, $page := $paginator.Pages }}
2019-04-01 04:00:48 -04:00
<article class="{{ if and $.IsHome (eq $paginator.PageNumber 1) (eq $index 0) }}first-entry{{ else }}post-entry{{ end }}">
2019-03-31 08:32:06 -04:00
<header class="entry-header">
<h2>{{ .Title }}</h2>
2018-01-08 11:28:39 -05:00
</header>
2019-03-31 08:32:06 -04:00
<section class="entry-content">
<p>{{ .Summary | plainify | htmlUnescape }}...</p>
</section>
<footer class="entry-footer">
<time>{{ .Date.Format (.Site.Params.dateFormat | default "2006.1.2") }}</time>
2018-01-08 11:28:39 -05:00
</footer>
2019-03-31 08:32:06 -04:00
<a class="entry-link" href="{{ .Permalink }}"></a>
2018-01-08 11:28:39 -05:00
</article>
{{ end }}
{{ end }}
2019-03-31 08:32:06 -04:00
2018-01-08 11:28:39 -05:00
{{ if gt $paginator.TotalPages 1 }}
2019-03-31 08:32:06 -04:00
<footer class="page-footer">
2018-01-08 11:28:39 -05:00
<nav class="pagination">
{{ if $paginator.HasPrev }}
2019-04-01 04:00:48 -04:00
<a class="prev" href="{{ $paginator.Prev.URL }}">← {{ i18n "prev_page" }}</a>
2018-01-08 11:28:39 -05:00
{{ end }}
{{ if $paginator.HasNext }}
2019-04-01 04:00:48 -04:00
<a class="next" href="{{ $paginator.Next.URL }}">{{ i18n "next_page" }} →</a>
2018-01-08 11:28:39 -05:00
{{ end }}
</nav>
</footer>
{{ end }}
2019-03-31 08:32:06 -04:00
2018-07-05 14:45:58 -04:00
{{ partial "footer.html" . }}