bunteshaus.de/themes/buha/layouts/partials/sidebar.html
2022-03-27 03:17:45 +02:00

41 lines
1.4 KiB
HTML

{{ $s := .Site.Params }}
<section class="sidebar_inner">
{{ if .IsSection }}
{{ $true := false }}
{{ range $taxonomyname, $taxonomy := where .Site.Taxonomies.categories ".Page.Section" .Section }}
{{ if ne $taxonomyname nil }}
{{ $true = true }}
{{ end }}
{{ end }}
{{ 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 }}
{{ end }}
<div id="nav-posts">
{{- $posts := where .Site.RegularPages "Type" "in" $s.mainSections }}
{{- $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 }}
<a href="{{ .Permalink }}" class="nav-link" title="{{ .Title }}">{{ .Title }}</a>
{{ end }}
</div>
</section>