diff --git a/layouts/partials/bootstrap/functions/data.html b/layouts/partials/bootstrap/functions/data.html index 3b412c1..7234a9a 100644 --- a/layouts/partials/bootstrap/functions/data.html +++ b/layouts/partials/bootstrap/functions/data.html @@ -1,10 +1,15 @@ -{{- $data := false }} -{{- $siteData := site.Data }} -{{- $keys := split . "." }} -{{- range $keys }} - {{- with index $siteData . }} - {{- $siteData = . }} - {{- $data = . }} +{{- $v := false }} +{{- $key := replace .key "." "/" | printf "%s.{toml,yaml,yml,json}" }} +{{- with .page.Resources.GetMatch $key }} + {{- $v = .Content | transform.Unmarshal }} +{{- else }} + {{- $data := site.Data }} + {{- $keys := split .key "." }} + {{- range $keys }} + {{- with index $data . }} + {{- $data = . }} + {{- $v = . }} + {{- end }} {{- end }} {{- end }} -{{- return $data -}} +{{- return $v -}} diff --git a/layouts/partials/bootstrap/icon-grid.html b/layouts/partials/bootstrap/icon-grid.html index cb8a466..d32d1f5 100644 --- a/layouts/partials/bootstrap/icon-grid.html +++ b/layouts/partials/bootstrap/icon-grid.html @@ -11,7 +11,7 @@ {{- else }} {{- $key = .Get 0 }} {{- end }} -{{- $data := partialCached "bootstrap/functions/data" $key $key }} +{{- $data := partialCached "bootstrap/functions/data" (dict "key" $key "page" .Page) .Page $key }} {{- with $data }}
{{- range sort . "weight" }}