2022-11-13 20:52:45 +01:00
|
|
|
{{ define "head" }}
|
|
|
|
{{ if eq .Type "blog" }}
|
|
|
|
{{ $latestEntry := index (where (where .Site.RegularPages "Type" "blog") "Params.featured" true).ByPublishDate.Reverse 0 }}
|
2022-11-20 15:04:48 +01:00
|
|
|
<div class="p-4 m-2 rounded text-bg-dark">
|
2022-11-13 20:52:45 +01:00
|
|
|
<div class="col-md6 px-0">
|
|
|
|
<h1 class="display-4 fst-italic">{{ $latestEntry.Title }}</h1>
|
2022-11-15 23:34:16 +01:00
|
|
|
<p class="lead my-3">{{ $latestEntry.Summary | safeHTML }}</p>
|
2022-11-13 20:52:45 +01:00
|
|
|
<p class="lead mb-0"><a href="{{ $latestEntry.Permalink }}" class="text-white fw-bold">Weiter lesen...</a></p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ define "main" }}
|
|
|
|
{{/* Paginator initialisieren, in der Reihenfolge die man sich im Blog wünscht */}}
|
|
|
|
{{ if eq .Type "blog" }}
|
|
|
|
{{/* Der 1te Weg soll alle Blog-Einträge finden*/}}
|
2022-11-15 23:34:16 +01:00
|
|
|
{{ $pag := .Paginate (where .Site.RegularPages "Type" "blog").ByPublishDate.Reverse }}
|
2022-11-13 20:52:45 +01:00
|
|
|
{{ else }}
|
|
|
|
{{/* Der 2te Weg ist über die Archive-Gruppierung, und dort wird nicht paginiert */}}
|
|
|
|
{{ $pag := .Paginate .Pages.ByPublishDate.Reverse 9999 }}
|
|
|
|
{{ end }}
|
|
|
|
{{/* Der Paginator wurde in den If-Blöcken zwar erstellt, aber die Variable ist auserhalb nicht sichtbar, daher hier explizit holen.
|
|
|
|
Dieser kann nach dem ersten erstellen auch nicht mehr verändert werden */}}
|
|
|
|
{{ $pag := .Paginator }}
|
|
|
|
{{ range $pag.Pages }}
|
|
|
|
<article class="blog-post">
|
2022-11-23 00:41:16 +01:00
|
|
|
<h3 class="blog-post-title_ mb-1"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3>
|
2022-11-13 20:52:45 +01:00
|
|
|
<p class="blog-post-meta">{{ partial "metadata.html" . }}</p>
|
|
|
|
<p>{{ .Summary }}</p>
|
|
|
|
</article>
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ template "partials/pagination.html" . }}
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ define "sidebar" }}
|
2022-11-23 00:41:16 +01:00
|
|
|
<div class="position-sticky" style="top: 0.5rem;">
|
|
|
|
{{ $catIdent := .Site.Params.Blog.Categories | default "categories" }}
|
|
|
|
{{ $cats := (index $.Site.Taxonomies $catIdent)}}
|
|
|
|
{{ if $cats }}
|
|
|
|
{{- partial "widget/header.html" (dict "title" "Kategorien") -}}
|
|
|
|
{{- partial "widget/taglist.html" (dict "ident" $catIdent "tax" $cats) -}}
|
|
|
|
{{ end }}
|
2022-11-13 20:52:45 +01:00
|
|
|
|
2022-11-23 00:41:16 +01:00
|
|
|
{{ $tagsIdent := .Site.Params.Blog.Tags | default "tags" }}
|
|
|
|
{{ $tags := (index $.Site.Taxonomies $tagsIdent)}}
|
|
|
|
{{ if $tags }}
|
|
|
|
{{- partial "widget/header.html" (dict "title" "Schlagwortwolke") -}}
|
|
|
|
{{- partial "widget/cloud.html" (dict "ident" $tagsIdent "tax" $tags) -}}
|
|
|
|
{{ end }}
|
2022-11-13 20:52:45 +01:00
|
|
|
|
2022-11-23 00:41:16 +01:00
|
|
|
{{- partial "widget/header.html" (dict "title" "Archive") -}}
|
|
|
|
<div class="mb-2 list-group">
|
|
|
|
{{/* Hier explizit auf Type achten!! */}}
|
|
|
|
{{ range (where .Site.RegularPages "Type" "blog").GroupByDate "2006" }}
|
|
|
|
<a class="list-group-item list-group-item-action" href="/blog/{{ .Key }}">Jahr {{ .Key }}</a>
|
|
|
|
{{ end }}
|
2022-11-13 20:52:45 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{ end }}
|