bunteshaus.de/themes/buha/layouts/partials/sidebar.html

41 lines
1.4 KiB
HTML
Raw Normal View History

2022-03-26 19:22:14 +01:00
{{ $s := .Site.Params }}
2021-10-23 22:20:01 +02:00
<section class="sidebar_inner">
<div id="nav-posts">
2022-03-26 19:22:14 +01:00
{{- $posts := where .Site.RegularPages "Type" "in" $s.mainSections }}
2021-10-23 22:20:01 +02:00
{{- $featured := default 8 $s.numberOfFeaturedPosts }}
{{- with first $featured (where $posts "Params.featured" true)}}
<h3 class="mt-4">{{ T "featured_posts" }}</h3>
{{- range . }}
<a href="{{ .Permalink }}" class="nav-link" title="{{ .Title }}">{{ .Title }}</a>
{{- end }}
{{- end }}
<h3 class="mt-4">{{ T "recurrent" }}</h3>
{{- $posts := where .Site.RegularPages "Params.recurrent" true }}
{{ range $posts }}
2022-03-26 19:22:14 +01:00
<a href="{{ .Permalink }}" class="nav-link" title="{{ .Title }}">{{ .Title }}</a>
2021-10-23 22:20:01 +02:00
{{ end }}
</div>
2022-03-26 19:22:14 +01:00
2022-03-27 03:16:23 +02:00
{{ if .IsSection }}
2022-03-26 19:22:14 +01:00
{{ $true := false }}
{{ range $taxonomyname, $taxonomy := where .Site.Taxonomies.categories ".Page.Section" .Section }}
{{ if ne $taxonomyname nil }}
{{ $true = true }}
2021-10-23 22:20:01 +02:00
{{ end }}
{{ end }}
2022-03-26 19:22:14 +01:00
{{ if $true }}
<h3 class="mt-4 taxonomy" id="categories-section">{{ T "categories" }}</h3>
{{ range $taxonomyname, $taxonomy := where .Site.Taxonomies.categories ".Page.Section" .Section }}
<li style="list-style: none;"><a href="{{ "categories/" | relLangURL}}{{ $taxonomyname | urlize }}">{{ $taxonomyname | humanize }}</a></li>
{{ end }}
{{ end }}
2022-03-27 03:16:23 +02:00
{{ end }}
2022-03-26 19:22:14 +01:00
</section>