2019-09-20 16:11:12 +00:00
|
|
|
{{ define "main" }}
|
|
|
|
<hr>
|
2020-05-12 08:31:55 +00:00
|
|
|
{{ .Content }}
|
2019-09-20 16:11:12 +00:00
|
|
|
|
2020-10-21 03:28:02 +00:00
|
|
|
{{- /* The homepage should show only pages from the given sections (with `$.Site.Params.mainSections`).
|
|
|
|
Otherwise, we take the pages of a section. */ -}}
|
2019-09-20 16:11:12 +00:00
|
|
|
{{ $pages := .Pages }}
|
|
|
|
{{ if .IsHome }}
|
|
|
|
{{ $pages = where $.Site.RegularPages "Type" "in" $.Site.Params.mainSections }}
|
|
|
|
{{ end }}
|
2020-10-21 03:28:02 +00:00
|
|
|
|
2020-05-12 08:31:55 +00:00
|
|
|
{{ range (where (.Paginate $pages).Pages "Params.hidden" "!=" true) }}
|
2019-09-20 16:11:12 +00:00
|
|
|
<article class="post">
|
2020-05-09 07:19:04 +00:00
|
|
|
<a href="{{ .Permalink }}" aria-label="{{ .Title }}"><h1>{{ .Title }}</h1></a>
|
2019-09-20 16:11:12 +00:00
|
|
|
<date datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "2006-01-02" }}</date>
|
|
|
|
</article>
|
|
|
|
{{ end }}
|
|
|
|
|
2020-05-11 15:59:06 +00:00
|
|
|
<div class="pagination">
|
|
|
|
{{- if .Paginator.HasPrev }}
|
|
|
|
{{- if ne .Paginator.First .Paginator.Prev -}}
|
|
|
|
<a rel="first" href="{{ .Paginator.First.URL }}">{{ i18n "first_page" }}</a>
|
|
|
|
{{- end }}
|
2019-09-20 16:11:12 +00:00
|
|
|
|
2020-05-11 15:59:06 +00:00
|
|
|
<a rel="prev" href="{{ .Paginator.Prev.URL }}">{{ i18n "prev_page" }}</a>
|
|
|
|
{{- end }}
|
2019-09-20 16:11:12 +00:00
|
|
|
|
2020-05-11 15:59:06 +00:00
|
|
|
{{- if .Paginator.HasNext -}}
|
|
|
|
<a rel="next" href="{{ .Paginator.Next.URL }}">{{ i18n "next_page" }}</a>
|
2019-09-20 16:11:12 +00:00
|
|
|
|
2020-05-11 15:59:06 +00:00
|
|
|
{{- if ne .Paginator.Last .Paginator.Next -}}
|
|
|
|
<a rel="last" href="{{ .Paginator.Last.URL }}">{{ i18n "last_page" }}</a>
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
2019-09-20 16:11:12 +00:00
|
|
|
</div>
|
2020-05-09 07:19:04 +00:00
|
|
|
{{ end }}
|