mirror of
https://github.com/foo-dogsquared/hugo-theme-contentful.git
synced 2025-01-31 10:58:07 +00:00
059a6c489c
Also, this is enough for a minor release.
36 lines
1.3 KiB
HTML
36 lines
1.3 KiB
HTML
{{ define "main" }}
|
|
<hr>
|
|
{{ .Content }}
|
|
|
|
{{- /* The homepage should show only pages from the given sections (with `$.Site.Params.mainSections`).
|
|
Otherwise, we take the pages of a section. */ -}}
|
|
{{ $pages := .Pages }}
|
|
{{ if .IsHome }}
|
|
{{ $pages = where $.Site.RegularPages "Type" "in" $.Site.Params.mainSections }}
|
|
{{ end }}
|
|
|
|
{{ range (where (.Paginate $pages).Pages "Params.hidden" "!=" true) }}
|
|
<article class="post">
|
|
<h1><a href="{{ .Permalink }}" aria-label="{{ .Title }}">{{ .Title }}</a></h1>
|
|
<div class="post__meta">
|
|
<span>
|
|
<time datetime="{{ .Date }}">
|
|
{{ .Date.Format "2006-01-02" }}
|
|
</time>
|
|
{{- if and .GitInfo (ne (.Date.Format "2006-01-02") (.Lastmod.Format "2006-01-02")) }}
|
|
(<time datetime="{{ .Lastmod }}">{{ .Lastmod.Format "2006-01-02" }}</time>)
|
|
{{- end }}
|
|
</span>
|
|
|
|
{{- /* 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 }}
|
|
</div>
|
|
</article>
|
|
{{ end }}
|
|
|
|
{{ partial "pagination.html" (dict "Paginator" .Paginator "activeNumberOfPages" 2) }}
|
|
{{ end }}
|