hugo-theme-contentful/layouts/_default/list.html
Gabriel Arazas aa67aa0932 Make minor adjustments to the theme
* Remove `hidden` as one of the content frontmatter.
* Adjust the post metadata output.
* Update the README.
2020-10-30 02:59:42 +08:00

35 lines
1.2 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 (.Paginate $pages).Pages }}
<article class="post">
<h1><a href="{{ .Permalink }}" aria-label="{{ .Title }}">{{ .Title }}</a></h1>
<div class="post__meta">
<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 }}
{{- /* 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 }}