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

40 lines
1.3 KiB
HTML
Raw Normal View History

2022-05-06 11:49:30 +02:00
{{ if and .amount .pages }}
2022-04-09 21:34:04 +02:00
{{ $amount := .amount }}
2022-04-10 11:18:04 +02:00
{{ $pages := .pages.ByLastmod.Reverse }}
2022-05-06 13:29:00 +02:00
{{ $p := .pages.ByLastmod.Reverse }}
2022-04-10 11:18:04 +02:00
{{- $paginator := .context.Paginate $pages -}}
2022-05-06 13:29:00 +02:00
{{ if .paginate }}
$p = $paginator.Pages
{{ end }}
2022-04-10 11:18:04 +02:00
{{ 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-05-06 13:29:00 +02:00
<section>
2022-04-11 15:45:49 +02:00
{{ if .title }}<h2>{{ .title }}</h2>{{ end }}
2022-05-06 13:29:00 +02:00
{{- range first $amount $p -}}
<article class="article_list" style="height: 32rem;">
2022-04-12 08:26:18 +02:00
<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-05-06 13:29:00 +02:00
</section>
2022-04-09 21:34:04 +02:00
{{ end }}
{{ end }}