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

41 lines
1.4 KiB
HTML

{{ if and .amount .pages }}
{{ $amount := .amount }}
{{ $pages := .pages.ByLastmod.Reverse }}
{{ $p := .pages.ByLastmod.Reverse }}
{{- $paginator := .context.Paginate $pages -}}
{{ if .paginate }}
{{ $p = $paginator.Pages }}
{{ end }}
{{ if eq $paginator.PageNumber 1 }}
{{ if .content }}
{{ partial "snippets/content" (dict "content" .content) }}
{{ end }}
{{ end }}
{{- if gt (len $pages) 0 -}}
<section>
{{ if .title }}<h2>{{ .title }}</h2>{{ end }}
{{- $home := .context.Kind }}
{{- range first $amount $p -}}
<article class="article_list {{- if eq $home "home" }} height32{{- end -}}">
<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 }}
</section>
{{ end }}
{{ end }}