bunteshaus.de/themes/buha/layouts/index.html
2022-04-04 12:44:19 +02:00

45 lines
1.3 KiB
HTML

{{ define "title" }}
<!-- {{ .Title }} -->
{{ end }}
{{ define "main" }}
<!-- <a href="/news"><h2>{{ "news" | T }}</h2></a> -->
{{ $s := .Site.Params }}
{{ $meta := false }}
{{- $posts := where (where .Site.RegularPages "Permalink" "!=" .Permalink) "Type" "in" $s.searchSections }}
{{- $paginator := slice -}}
{{- $paginator = .Paginate $posts.ByDate.Reverse -}}
<!-- <a href="/featured"><h2>{{ "featured" | T }}</h2></a> -->
{{ if eq $paginator.PageNumber 1 }}
{{ if ne .Content "" }}
<article>
{{ .Content }}
</article>
{{ end }}
{{ range first 3 (where (where .Site.RegularPages "Type" "in" site.Params.searchSections) ".Params.featured" "=" true) }}
{{ $article_age := sub now.Unix (int .Date.Unix) }}
{{ if lt $article_age "1209600" }}
{{ partial "structure/list_article.html" . }}
{{ end }}
{{ end }}
{{ end }}
{{- range first 5 $paginator.Pages -}}
{{ $article_age := sub now.Unix (int .Date.Unix) }}
{{ if or (ne .Params.featured true) (ge $article_age "1209600") }}
{{ partial "structure/list_article.html" . }}
{{ end }}
{{- end }}
<div id="pagination_outer" style="display: flex; justify-content: center;">
{{ partial "structure/paginator" (dict "paginator" $paginator) }}
</div>
{{ end }}
{{ define "sidebar" }}
{{- partial "structure/sidebar" . }}
{{ end }}