forked from Bunteshaus/bunteshaus.de
46 lines
1.3 KiB
HTML
46 lines
1.3 KiB
HTML
{{ define "title" }}
|
|
{{ if .Content }}
|
|
<h1>{{ .Title }}</h1>
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ define "main" }}
|
|
{{ now }}<br>
|
|
{{ $diffp := now.AddDate 0 0 14 }}
|
|
{{ $diffn := now.AddDate 0 0 -14 }}
|
|
{{ $diffp }}<br>
|
|
{{ $diffn }}<br>
|
|
|
|
|
|
|
|
{{ partial "debug" (dict "context" . "filename" "index.html") }}
|
|
|
|
{{ $s := .Site.Params }}
|
|
{{- $posts := where (where .Site.RegularPages "Permalink" "!=" .Permalink) "Type" "in" $s.searchSections }}
|
|
{{- $featured := where (where $posts ".Params.featured" "=" true) "Type" "in" $s.searchSections }}
|
|
{{- $paginator := .Paginate $posts -}}
|
|
{{ if eq $paginator.PageNumber 1 }}
|
|
{{ if ne .Content "" }}
|
|
<article>
|
|
{{ .Content }}
|
|
</article>
|
|
{{ end }}
|
|
<a href="/featured"><h2>{{ "featured" | T }}</h2></a>
|
|
{{ partial "contentlayouts/list.html" (dict "context" . "pages" $featured "amount" "3" "max_age" "3" "featured" "true") }}
|
|
{{ end }}
|
|
<a href="/news"><h2>{{ "news" | T }}</h2></a>
|
|
|
|
{{ partial "contentlayouts/list.html" (dict "context" . "paginator" $paginator "amount" "5" "max_age" "-14") }}
|
|
|
|
<div id="pagination_outer" style="display: flex; justify-content: center;">
|
|
{{ partial "structure/paginator" (dict "paginator" $paginator) }}
|
|
</div>
|
|
|
|
|
|
{{ end }}
|
|
|
|
{{ define "sidebar" }}
|
|
{{- partial "contentlayouts/menu.html" . }}
|
|
{{ end }}
|
|
|