summaryrefslogtreecommitdiff
path: root/themes/new_theme/layouts/partials/sidebar.html
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2020-06-05 16:57:53 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2020-06-05 16:57:53 +0200
commit983b64ca51f5e769f790a5ebc55e3808157b8d94 (patch)
tree4fb52d8e2f449e44a51ed0549cec9debbcd3d157 /themes/new_theme/layouts/partials/sidebar.html
parentff7e6bde0be9ac60e694097ce3598f9b552c4807 (diff)
downloadwww-andreasbaumann-cc-983b64ca51f5e769f790a5ebc55e3808157b8d94.tar.gz
www-andreasbaumann-cc-983b64ca51f5e769f790a5ebc55e3808157b8d94.tar.bz2
updated to newest theme supporting newer hugo versions
Diffstat (limited to 'themes/new_theme/layouts/partials/sidebar.html')
-rw-r--r--themes/new_theme/layouts/partials/sidebar.html30
1 files changed, 21 insertions, 9 deletions
diff --git a/themes/new_theme/layouts/partials/sidebar.html b/themes/new_theme/layouts/partials/sidebar.html
index 4fc8150..c4fd283 100644
--- a/themes/new_theme/layouts/partials/sidebar.html
+++ b/themes/new_theme/layouts/partials/sidebar.html
@@ -1,10 +1,22 @@
-<aside class="sidebar" itemscope="itemscope" itemtype="http://schema.org/WPSideBar">
- {{ partial "widgets/dataprotection.html" . }}
- {{ partial "widgets/elasticlunr_search.html" . }}
- {{ $section := .Section }}
- {{ if or ( eq $section "blog" ) ( eq $section "" ) ( eq $section "categories" ) }}
- {{ partial "widgets/recent.html" . }}
- {{ partial "widgets/categories.html" . }}
- {{ partial "widgets/taglist.html" . }}
- {{ end }}
+{{- $sidebar := false }}
+{{- if eq .Kind "home" -}}
+ {{ $sidebar = (default .Site.Params.sidebar.home .Params.sidebar) }}
+{{- else if eq .Kind "page" -}}
+ {{ $sidebar = (default .Site.Params.sidebar.single .Params.sidebar) }}
+{{- else -}}
+ {{ $sidebar = (default .Site.Params.sidebar.list .Params.sidebar) }}
+{{ end }}
+
+{{- if $sidebar -}}
+<aside class="sidebar{{ if eq $sidebar "left" }} sidebar--left{{ end }}">
+{{- $root := . }}
+{{- with (default .Site.Params.sidebar.widgets .Params.widgets) -}}
+ {{- range $widget := . }}
+ {{- $p := printf "widgets/%s.html" $widget }}
+ {{- partial $p $root }}
+ {{- end }}
+{{- else }}
+ <p class="sidebar__warning"><strong>{{ T "sidebar_warning" }}:</strong><br>{{ T "sidebar_recommendation" }}</p>
+{{- end }}
</aside>
+{{- end }}