bunteshaus.de/themes/buha/layouts/index.html

31 lines
1.6 KiB
HTML

{{ define "content" }}
{{- $all := where (where .Site.RegularPages "Permalink" "!=" .Permalink) "Type" "in" .Site.Params.searchSections }}
{{ $days := int (mul (mul (int .Site.Params.featured_expire) 7) -1) }}
{{ $featured := where (where (where $all ".Params.featured" "=" true) "Type" "in" .Site.Params.searchSections) ".Params.Lastmod" "gt" (now.AddDate 0 0 $days) }}
{{ $featured = $all | intersect $featured }}
{{ $posts := $all | complement $featured }}
{{- $paginator := .Paginate $posts -}}
{{ if eq $paginator.PageNumber 1 }}
{{ if ne .Content "" }}
{{ partial "snippets/content" (dict "content" .Content) }}
{{ end }}
{{ partial "layout/article_list" (dict "context" . "pages" $featured "amount" "3" "title" "Featured") }}
{{ end }}
{{ if gt (len $posts) 1 }}
{{ partial "layout/article_list" (dict "context" . "pages" $posts "amount" "5" "title" "News" "paginate" true) }}
{{ end }}
{{ end }}
{{ define "banner" }}
{{ if .Resources.Match "banner*" }}
{{ $img := (.Resources.GetMatch "banner*") }}
<div style="background-image:linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url({{- $img.Permalink -}}); background-size: cover; min-height: 33vh; display: flex; justify-content: center; align-items: center;"><h1 style="font-size: xx-large; text-shadow: -2px 0px 3px rgba(0,0,0,.25), -2px -2px 3px rgba(0,0,0,.25), 0px 2px 3px rgba(0,0,0,.25), 2px 2px 3px rgba(0,0,0,.25); ">{{ .Title }}</h1></div>
{{ else }}
<h1 style="margin-top: 1rem; margin-left: 1rem; margin-bottom: 0; color: white;">{{ .Title }}</h1>
{{ end }}
{{ end }}
{{ define "sidebar" }}
{{ "" }}
{{ end }}