bunteshaus.de/themes/buha/layouts/partials/l1/article_list.html
2022-04-11 15:46:02 +02:00

35 lines
1.2 KiB
HTML

{{ if and .amount (or .paginator .pages) }}
{{ $amount := .amount }}
{{ $pages := .pages.ByLastmod.Reverse }}
{{ if .paginator }}
{{ $pages = .paginator.Pages.ByLastmod.Reverse }}
{{ end }}
{{- $paginator := .context.Paginate $pages -}}
{{ if eq $paginator.PageNumber 1 }}
{{ if .content }}
{{ partial "snippets/content" (dict "content" .content) }}
{{ end }}
{{ end }}
{{- if gt (len $pages) 0 -}}
{{ if .title }}<h2>{{ .title }}</h2>{{ end }}
{{- range first $amount $pages -}}
<article id="article_list">
<a href="{{- .Permalink -}}">
<div id="articletitle">
<h2>{{- .Title -}}</h2>
</div>
</a>
<a href="{{- .Permalink -}}">
<div id="articlecontent">
{{ partial "layout/article" (dict "context" . "type" "list" "pic" "true") }}
</div>
</a>
</article>
{{ end }}
{{ if .paginate }}
{{ partial "snippets/paginator" (dict "paginator" $paginator) }}
{{ end }}
{{ end }}
{{ end }}