Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CaiJimmy/hugo-theme-stack.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/sidebar/right.html')
-rw-r--r--layouts/partials/sidebar/right.html13
1 files changed, 9 insertions, 4 deletions
diff --git a/layouts/partials/sidebar/right.html b/layouts/partials/sidebar/right.html
index 24763bb..d2a6ae8 100644
--- a/layouts/partials/sidebar/right.html
+++ b/layouts/partials/sidebar/right.html
@@ -1,8 +1,13 @@
-{{ if .Site.Params.widgets.enabled }}
- {{ $context := . }}
+{{- $scope := default "homepage" .Scope -}}
+{{- $context := .Context -}}
+{{- with (index .Context.Site.Params.widgets $scope) -}}
<aside class="sidebar right-sidebar sticky">
- {{ range $widget := .Site.Params.widgets.enabled }}
- {{ partial (printf "widget/%s" $widget) $context }}
+ {{ range $widget := . }}
+ {{ if templates.Exists (printf "partials/widget/%s.html" .type) }}
+ {{ partial (printf "widget/%s" .type) (dict "Context" $context "Params" .params) }}
+ {{ else }}
+ {{ warnf "Widget %s not found" .type }}
+ {{ end }}
{{ end }}
</aside>
{{ end }} \ No newline at end of file