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-10-29 18:59:42 +00:00
|
|
|
{{ range (.Paginate $pages).Pages }}
|
2019-09-20 16:11:12 +00:00
|
|
|
<article class="post">
|
2020-10-23 19:13:14 +00:00
|
|
|
<h1><a href="{{ .Permalink }}" aria-label="{{ .Title }}">{{ .Title }}</a></h1>
|
|
|
|
<div class="post__meta">
|
2020-11-05 18:25:43 +00:00
|
|
|
<time datetime="{{ .PublishDate }}">
|
|
|
|
{{ .PublishDate.Format "2006-01-02" }}
|
2020-10-29 18:59:42 +00:00
|
|
|
</time>
|
|
|
|
|
2020-11-05 18:25:43 +00:00
|
|
|
{{- if and .GitInfo (ne (.PublishDate.Format "2006-01-02") (.Lastmod.Format "2006-01-02")) }}
|
2020-10-29 18:59:42 +00:00
|
|
|
<time datetime="{{ .Lastmod }}">{{ .Lastmod.Format "2006-01-02" }}</time>
|
|
|
|
{{- end }}
|
2020-10-27 18:06:16 +00:00
|
|
|
|
|
|
|
{{- /* The authors are appended with 'et al' if there's more than one author in the map. */ -}}
|
|
|
|
{{ with .Params.author }}
|
|
|
|
{{ $author := index (first 1 .) 0 }}
|
|
|
|
<span data-authors="{{ jsonify . }}">{{ $author.name }}{{ if ge (len .) 2 }}, et al.{{ end }}</span>
|
|
|
|
{{ end }}
|
2020-10-23 19:13:14 +00:00
|
|
|
</div>
|
2019-09-20 16:11:12 +00:00
|
|
|
</article>
|
|
|
|
{{ end }}
|
|
|
|
|
2020-10-23 19:09:11 +00:00
|
|
|
{{ partial "pagination.html" (dict "Paginator" .Paginator "activeNumberOfPages" 2) }}
|
2020-05-09 07:19:04 +00:00
|
|
|
{{ end }}
|