2022-04-09 21:34:04 +02:00
|
|
|
{{ define "content" }}
|
2022-04-08 14:44:17 +02:00
|
|
|
{{- $all := where (where .Site.RegularPages "Permalink" "!=" .Permalink) "Type" "in" .Site.Params.searchSections }}
|
2022-04-08 15:02:22 +02:00
|
|
|
{{ $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) }}
|
2022-04-08 14:42:30 +02:00
|
|
|
{{ $featured = $all | intersect $featured }}
|
|
|
|
{{ $posts := $all | complement $featured }}
|
2022-04-07 16:31:15 +02:00
|
|
|
{{- $paginator := .Paginate $posts -}}
|
2022-03-27 16:47:39 +02:00
|
|
|
{{ if eq $paginator.PageNumber 1 }}
|
|
|
|
{{ if ne .Content "" }}
|
2022-04-09 21:34:04 +02:00
|
|
|
{{ partial "snippets/content" (dict "content" .Content) }}
|
2022-04-08 13:22:50 +02:00
|
|
|
{{ end }}
|
2022-04-28 14:53:58 +02:00
|
|
|
{{ partial "layout/article_list" (dict "context" . "pages" $featured "amount" "3" "title" "Featured") }}
|
2022-03-27 16:47:39 +02:00
|
|
|
{{ end }}
|
2022-04-08 13:22:50 +02:00
|
|
|
{{ if gt (len $posts) 1 }}
|
2022-05-06 11:49:30 +02:00
|
|
|
{{ partial "layout/article_list" (dict "context" . "pages" $posts "amount" "5" "title" "News" "paginate" true) }}
|
2022-04-08 13:22:50 +02:00
|
|
|
{{ end }}
|
2022-03-26 19:22:14 +01:00
|
|
|
{{ end }}
|
2022-05-06 11:49:30 +02:00
|
|
|
|
|
|
|
{{ 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 }}
|