We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ad743a1 commit 96a6fc9Copy full SHA for 96a6fc9
layouts/partials/base/functions/data.html
@@ -0,0 +1,15 @@
1
+{{- $v := false }}
2
+{{- $key := replace .key "." "/" | printf "%s.{toml,yaml,yml,json}" }}
3
+{{- with .page.Resources.GetMatch $key }}
4
+ {{- $v = .Content | transform.Unmarshal }}
5
+{{- else }}
6
+ {{- $data := site.Data }}
7
+ {{- $keys := split .key "." }}
8
+ {{- range $keys }}
9
+ {{- with index $data . }}
10
+ {{- $data = . }}
11
+ {{- $v = . }}
12
+ {{- end }}
13
14
+{{- end }}
15
+{{- return $v -}}
0 commit comments