1
0
Fork 0
hugo-paper/layouts/_default/list.html

35 lines
915 B
HTML
Raw Normal View History

2021-08-23 21:59:02 +02:00
{{ define "main" }}
2019-03-31 14:32:06 +02:00
2021-08-23 21:59:02 +02:00
<!-- Main Title -->
2021-08-20 13:21:20 +02:00
{{ if .Title }}
2021-08-23 21:59:02 +02:00
<h1 class="main-title">{{ .Title }}</h1>
2020-03-09 18:50:02 +01:00
{{ end }}
2020-03-09 16:56:13 +01:00
2021-08-23 21:59:02 +02:00
<!-- $pages -->
2021-08-20 13:21:20 +02:00
{{ $pages := union .RegularPages .Sections }}
2021-08-23 21:59:02 +02:00
<!---->{{ if .IsHome }} {{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
2021-08-20 13:21:20 +02:00
{{ end }}
2019-03-31 14:32:06 +02:00
2021-08-23 21:59:02 +02:00
<!-- Articles -->
{{ $paginator := .Paginate $pages }} {{ range $index, $page := $paginator.Pages }}
2021-08-20 13:21:20 +02:00
<article class="post-entry">
<h2>{{ .Title }}</h2>
2021-09-04 00:33:47 +02:00
<time>{{ .Date | time.Format ":date_medium" }}</time>
2021-08-20 13:21:20 +02:00
<a href="{{ .Permalink }}"></a>
2018-01-08 17:28:39 +01:00
</article>
2021-08-20 13:21:20 +02:00
{{ end }}
2019-03-31 14:32:06 +02:00
2021-08-23 21:59:02 +02:00
<!-- Main Nav -->
2021-08-20 13:21:20 +02:00
{{ if gt $paginator.TotalPages 1 }}
2021-08-23 21:59:02 +02:00
<nav class="main-nav">
2021-08-20 13:21:20 +02:00
{{ if $paginator.HasPrev }}
<a class="prev" href="{{ $paginator.Prev.URL }}">← {{ i18n "prev_page" }}</a>
2021-08-23 21:59:02 +02:00
{{ end }}<!---->
2021-08-20 13:21:20 +02:00
{{ if $paginator.HasNext }}
<a class="next" href="{{ $paginator.Next.URL }}">{{ i18n "next_page" }} →</a>
{{ end }}
</nav>
2021-08-23 21:59:02 +02:00
{{ end }}<!---->
2019-03-31 14:32:06 +02:00
2021-08-23 21:59:02 +02:00
{{ end }}