Files
hugo-theme-stack/layouts/_partials/sidebar/right.html
T

16 lines
651 B
HTML
Raw Normal View History

2022-02-26 23:45:25 +01:00
{{- $scope := default "homepage" .Scope -}}
{{- $context := .Context -}}
{{- with (index .Context.Site.Params.widgets $scope) -}}
2020-08-22 13:20:08 +02:00
<aside class="sidebar right-sidebar sticky">
2022-02-26 23:45:25 +01:00
{{ range $widget := . }}
{{ if templates.Exists (printf "_partials/widget/%s.html" .type) }}
<!-- Ensure that the `params` is not nil -->
{{- $params := default dict .params -}}
{{ partial (printf "widget/%s" .type) (dict "Context" $context "Params" $params) }}
2022-02-26 23:45:25 +01:00
{{ else }}
{{ warnf "Widget %s not found" .type }}
{{ end }}
2020-08-22 13:20:08 +02:00
{{ end }}
</aside>
{{ end }}