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

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 class="article_list">
<a href="{{- .Permalink -}}" class="no_underline">
<div class="articletitle">
<h2>{{- .Title -}}</h2>
</div>
</a>
<a href="{{- .Permalink -}}" class="no_underline">
<div class="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 }}