2021-10-23 22:20:01 +02:00
|
|
|
{{ define "title" }}
|
2022-04-05 15:47:23 +02:00
|
|
|
{{ if .Content }}
|
|
|
|
<h1>{{ .Title }}</h1>
|
|
|
|
{{ end }}
|
2021-10-23 22:20:01 +02:00
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ define "main" }}
|
2022-03-26 19:22:14 +01:00
|
|
|
{{ $s := .Site.Params }}
|
2022-04-04 12:44:19 +02:00
|
|
|
{{- $posts := where (where .Site.RegularPages "Permalink" "!=" .Permalink) "Type" "in" $s.searchSections }}
|
2022-04-04 13:05:33 +02:00
|
|
|
{{- $featured := where (where $posts ".Params.featured" "=" true) "Type" "in" $s.searchSections }}
|
2022-04-08 14:12:20 +02:00
|
|
|
{{ $featured = where $featured ".Params.Lastmod" "gt" (now.AddDate 0 0 -14) }}
|
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 "" }}
|
|
|
|
<article>
|
|
|
|
{{ .Content }}
|
|
|
|
</article>
|
2022-04-08 13:22:50 +02:00
|
|
|
{{ end }}
|
|
|
|
{{ if gt (len $featured) 0 }}
|
|
|
|
<a href="/featured"><h2>{{if "featured" | i18n }}{{ "featured" | i18n }}{{ else }}{{ "Featured" }}{{ end }}</h2></a>
|
|
|
|
{{ partial "contentlayouts/list.html" (dict "context" . "pages" $featured "amount" "3" "max_age" "14" "featured" "true") }}
|
|
|
|
{{ end }}
|
2022-03-27 16:47:39 +02:00
|
|
|
{{ end }}
|
2022-04-08 13:22:50 +02:00
|
|
|
{{ if gt (len $posts) 1 }}
|
|
|
|
<a href="/news"><h2>{{ if "news" | i18n }}{{ "news" | i18n }}{{ else }}{{ "News" }}{{ end }}</h2></a>
|
|
|
|
{{ partial "contentlayouts/list.html" (dict "context" . "paginator" $paginator "amount" "5" "max_age" "-14") }}
|
2022-04-07 16:31:15 +02:00
|
|
|
|
2022-04-08 13:22:50 +02:00
|
|
|
<div id="pagination_outer" style="display: flex; justify-content: center;">
|
|
|
|
{{ partial "structure/paginator" (dict "paginator" $paginator) }}
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
2022-03-26 19:22:14 +01:00
|
|
|
|
2022-03-27 16:47:39 +02:00
|
|
|
|
2022-03-26 19:22:14 +01:00
|
|
|
{{ end }}
|
2022-03-26 20:28:14 +01:00
|
|
|
|
|
|
|
{{ define "sidebar" }}
|
2022-04-05 20:58:02 +02:00
|
|
|
{{- partial "contentlayouts/menu.html" . }}
|
2022-04-03 21:08:42 +02:00
|
|
|
{{ end }}
|
|
|
|
|