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

90 lines
3.8 KiB
HTML
Raw Normal View History

2022-05-10 04:16:08 +02:00
{{ if and .amount .pages }}
{{ $amount := .amount }}
{{ $type := .type }}
{{ $title := .title }}
{{ $pages := .pages.ByLastmod.Reverse }}
{{ $p := .pages.ByLastmod.Reverse }}
{{- $paginator := .context.Paginate $pages -}}
2022-04-10 11:18:04 +02:00
2022-05-10 04:16:08 +02:00
{{ if .paginate }}
{{ $p = $paginator.Pages }}
{{ end }}
2022-05-06 13:29:00 +02:00
2022-05-10 04:16:08 +02:00
{{ if eq $paginator.PageNumber 1 }}
{{ if .content }}
{{ partial "snippets/content" (dict "content" .content) }}
2022-05-06 13:29:00 +02:00
{{ end }}
2022-05-10 04:16:08 +02:00
{{ end }}
{{- if gt (len $pages) 0 -}}
<section class="list">
{{ if .title }}<h2>{{ .title }}</h2>{{ end }}
{{- $home := .context.Kind }}
{{- range first $amount $p -}}
{{ $px := string "400" }}
{{ $fill := string (printf "1280x%s smart" $px) }}
{{ $banner := slice }}
{{ $image := slice }}
{{ $thumb := "" }}
{{ if .Resources.GetMatch "banner*" }}
{{ $banner = slice (.Resources.GetMatch "banner*") }}
2022-04-10 11:18:04 +02:00
{{ end }}
2022-05-10 04:16:08 +02:00
{{ if .Resources.ByType "image" }}
{{ $image = .Resources.ByType "image" }}
{{ end }}
{{ $image = (index (complement $banner $image) 0) }}
{{ $banner = (index $banner 0) }}
2022-05-09 21:37:34 +02:00
2022-05-10 04:16:08 +02:00
{{ $thumb = $banner.Fill $fill }}
{{ $bg_pic := "" }}
<article class="article_list_section">
<a href="{{- .Permalink -}}" class="no_underline">
<div class="articlecontent">
{{ $metas := dict "when" .Params.when "price" .Params.price }}
{{ $thumb := "" }}
{{ $banner := slice }}
{{ if (.Resources.GetMatch "banner*") }}
{{ if $banner = slice (.Resources.GetMatch "banner*") }}
{{ $banner = (index $banner 0) }}
{{ $thumb = $banner}}
{{ $thumb = $banner.Fill $fill }}
{{ $bg_pic = safeCSS (printf "background: url(%s)" $thumb.Permalink) }}
{{ end }}
{{ end }}
<div style="background-color: var(--background-alt); {{ $bg_pic }}; background-position: top; background-repeat: no-repeat; {{ safeCSS (printf "min-height: %spx" (string $px)) }}; box-shadow: inset 0px 11px 8px -10px #222, inset 0px -11px 8px -10px #222; margin-bottom: 4rem;">
<div style="display: flex; flex-direction: column;">
<div style="margin-top: 5rem;" class="article_content article_content articletitle">
{{ $cat := "" }}
{{ if .Page.Params.events }}
{{ $cat = index .Page.Params.events 0 }}
{{ $cat = printf "%s: " $cat }}
{{ end }}
{{ if eq $type "index" }}
<h3>{{ $cat -}}{{- .Title -}}</h3>
{{ else }}
<h2>{{ $cat -}}{{- .Title -}}</h2>
{{ end }}
{{ partial "snippets/article_metadata" $metas }}
<div style="display: flex;">
{{- if .Content -}}
<div>
{{- .Summary -}}
</div>
2022-05-09 23:51:57 +02:00
{{ end }}
</div>
</div>
2022-05-10 04:16:08 +02:00
</div>
2022-04-09 21:34:04 +02:00
</div>
2022-05-10 04:16:08 +02:00
</div>
</a>
</article>
2022-04-09 21:34:04 +02:00
{{ end }}
2022-05-10 04:16:08 +02:00
{{ if .paginate }}
{{ partial "snippets/paginator" (dict "paginator" $paginator) }}
{{ end }}
</section>
{{ end }}
2022-04-09 21:34:04 +02:00
{{ end }}