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:
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user