forked from Frontend/Homepage
Let value shortcode display data from page metadata (below "values") first and then fallback to global values
This commit is contained in:
parent
6669387f75
commit
8e18468f1f
|
@ -6,7 +6,9 @@
|
|||
{{- if not $key }}
|
||||
{{- errorf "missing parameter 'key': %s" .Position }}
|
||||
{{- end }}
|
||||
{{- $value := index $.Site.Data.values $section $key }}
|
||||
{{- $page := index (default dict (index (default dict (index $.Page.Params "values")) $section)) $key }}
|
||||
{{- $site := index (default dict (index $.Site.Data.values $section)) $key }}
|
||||
{{- $value := default $site $page }}
|
||||
{{- if not $value }}
|
||||
{{- errorf "missing, empty or null value at 'values/%s.%s': %s" $section $key .Position }}
|
||||
{{- end }}
|
||||
|
|
Loading…
Reference in New Issue