Browse Source

refactor(search): use locally scroped scratch

closes #52
Josh Habdas 1 year ago
parent
commit
6848337437
Signed by: Josh Habdas <jhabdas@protonmail.com> GPG Key ID: B148B31154C75A74
1 changed files with 4 additions and 3 deletions
  1. 4
    3
      layouts/_default/index.json

+ 4
- 3
layouts/_default/index.json View File

@@ -1,7 +1,8 @@
1
-{{- $.Scratch.Add "index" slice -}}
1
+{{- $scratch := newScratch -}}
2
+{{- $scratch.Add "index" slice -}}
2 3
 {{- range .Site.RegularPages -}}
3 4
   {{- if ne .Params.noindex true -}}
4
-    {{- $.Scratch.Add "index" (dict "title" .Title "tags" .Params.tags "categories" .Params.categories "contents" .Plain "url" .RelPermalink "summary" .Summary) -}}
5
+    {{- $scratch.Add "index" (dict "title" .Title "tags" .Params.tags "categories" .Params.categories "contents" .Plain "url" .RelPermalink "summary" .Summary) -}}
5 6
   {{- end -}}
6 7
 {{- end -}}
7
-{{- $.Scratch.Get "index" | jsonify -}}
8
+{{- $scratch.Get "index" | jsonify -}}

Loading…
Cancel
Save