Rename scratch var

This commit is contained in:
Salim B authored and Bjørn Erik Pedersen committed 2021-05-03 21:08:23 +02:00
1 parent 44193f267d
commit 696fa92e11
1 file changed
+3 -3
+3 -3
View File
@@ -10,12 +10,12 @@ Usage: {{< getcontent path="PATH/TO/FILE" >}}
{{ $scratch := newScratch -}} {{ $scratch := newScratch -}}
{{ with $glob -}} {{ with $glob -}}
{{ $bundle := site.GetPage $path -}} {{ $bundle := site.GetPage $path -}}
{{ $scratch.Set "pages" ($bundle.Resources.Match $glob) -}} {{ $scratch.Set "resources" ($bundle.Resources.Match $glob) -}}
{{ else -}} {{ else -}}
{{ $bundle := site.GetPage (path.Dir $path) -}} {{ $bundle := site.GetPage (path.Dir $path) -}}
{{ $scratch.Set "pages" ($bundle.Resources.Match (path.Base $path)) -}} {{ $scratch.Set "resources" ($bundle.Resources.Match (path.Base $path)) -}}
{{ end -}} {{ end -}}
{{ range ($scratch.Get "pages") -}} {{ range ($scratch.Get "resources") -}}
{{ .Content }} {{ .Content }}
{{ end -}} {{ end -}}