fix(lazyimg): normalize config dict in partial instead of shortcode

- move normalization of provided config dictionary keys to lower case
from shortcode to partial
- allows using any case when supplying config dict from other layouts
This commit is contained in:
kdevo
2021-10-30 11:21:31 +02:00
parent 0efce069c3
commit 45b704ebdb
2 changed files with 8 additions and 8 deletions
+1 -6
View File
@@ -1,10 +1,5 @@
{{ if .IsNamedParams -}}
{{ $params := dict }}
{{/* Normalize by transforming all keys to lower-case: */}}
{{ range $k, $v := .Params -}}
{{ $params = $params | merge (dict (lower $k) $v) }}
{{- end -}}
{{ partial "lazyimg" $params }}
{{ partial "lazyimg" .Params }}
{{- else -}}
{{ partial "lazyimg" (.Get 0) }}
{{- end }}