bunteshaus.de/themes/buha/layouts/partials/contentlayouts/list.html

45 lines
1.6 KiB
HTML

{{ if or .paginator .pages }}
{{ if .amount }}
{{ $amount := .amount }}
{{ $pages := "" }}
{{ $max_age := int .max_age }}
{{ $featured := .featured }}
{{ if .pages }}
{{ $pages = .pages.ByLastmod.Reverse }}
{{ else if .paginator }}
{{ $pages = .paginator.Pages.ByLastmod.Reverse }}
{{ end }}
{{- range first $amount $pages -}}
{{ $true := true }}
{{ if $featured }}
{{ if le (.Lastmod.AddDate 0 0 $max_age) now }}
{{ $true = false }}
{{ end }}
{{ else }}
{{ if $max_age }}
{{ if and (lt (.Lastmod.AddDate 0 0 $max_age) now) (eq .Params.featured true) }}
{{ $true = false }}
{{ end }}
{{ end }}
{{ end }}
{{ if eq $true true }}
{{ if .Title }}
<article class="articlebgcol1 borderrad25">
<a href="{{- .Permalink -}}">
<div id="articletitle">
<h2>{{- .Title -}}</h2>
</div>
</a>
<a href="{{- .Permalink -}}">
<div id="articlecontent">
{{ partial "contentlayouts/article.html" (dict "context" . "type" "list") }}
</div>
</a>
</article>
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}