bunteshaus.de/themes/buha/layouts/partials/layout/article_list.html

35 lines
1.2 KiB
HTML
Raw Normal View History

2022-04-10 11:18:04 +02:00
{{ if and .amount (or .paginator .pages) }}
2022-04-09 21:34:04 +02:00
{{ $amount := .amount }}
2022-04-10 11:18:04 +02:00
{{ $pages := .pages.ByLastmod.Reverse }}
{{ if .paginator }}
2022-04-09 21:34:04 +02:00
{{ $pages = .paginator.Pages.ByLastmod.Reverse }}
{{ end }}
2022-04-10 11:18:04 +02:00
{{- $paginator := .context.Paginate $pages -}}
{{ if eq $paginator.PageNumber 1 }}
{{ if .content }}
{{ partial "snippets/content" (dict "content" .content) }}
{{ end }}
{{ end }}
2022-04-09 21:34:04 +02:00
{{- if gt (len $pages) 0 -}}
2022-04-11 15:45:49 +02:00
{{ if .title }}<h2>{{ .title }}</h2>{{ end }}
2022-04-09 21:34:04 +02:00
{{- range first $amount $pages -}}
2022-04-12 08:26:18 +02:00
<article class="article_list">
<a href="{{- .Permalink -}}" class="no_underline">
<div class="articletitle">
2022-04-09 21:34:04 +02:00
<h2>{{- .Title -}}</h2>
</div>
</a>
2022-04-12 08:26:18 +02:00
<a href="{{- .Permalink -}}" class="no_underline">
<div class="articlecontent">
2022-04-10 11:00:14 +02:00
{{ partial "layout/article" (dict "context" . "type" "list" "pic" "true") }}
2022-04-09 21:34:04 +02:00
</div>
</a>
</article>
{{ end }}
2022-04-10 11:18:04 +02:00
{{ if .paginate }}
{{ partial "snippets/paginator" (dict "paginator" $paginator) }}
{{ end }}
2022-04-09 21:34:04 +02:00
{{ end }}
{{ end }}