style(widgets): default no pipes required

This commit is contained in:
WaterLemons2k 2024-02-20 12:30:00 +08:00
parent fe72738d8f
commit ee4a7b483b

View File

@ -4,8 +4,8 @@
<aside class="sidebar right-sidebar sticky"> <aside class="sidebar right-sidebar sticky">
{{ range $widget := . }} {{ range $widget := . }}
{{ if templates.Exists (printf "partials/widget/%s.html" .type) }} {{ if templates.Exists (printf "partials/widget/%s.html" .type) }}
<!-- Ensure that the params always exist --> <!-- Ensure that the `params` is not nil -->
{{- $params := .params | default (dict) -}} {{- $params := default dict .params -}}
{{ partial (printf "widget/%s" .type) (dict "Context" $context "Params" $params) }} {{ partial (printf "widget/%s" .type) (dict "Context" $context "Params" $params) }}
{{ else }} {{ else }}