blob: 6333f10dfe59f072ef695d2837461d3817c810b0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
{{- $scope := default "homepage" .Scope -}}
{{- $context := .Context -}}
{{- with (index .Context.Site.Params.widgets $scope) -}}
<aside class="sidebar right-sidebar sticky">
{{ 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) }}
{{ else }}
{{ warnf "Widget %s not found" .type }}
{{ end }}
{{ end }}
</aside>
{{ end }}
|