🐛 Fix JSON output duplicated items

pull/100/head
James Panther 2022-02-03 11:46:21 +11:00
parent 1672e2e501
commit e9ce1e3214
No known key found for this signature in database
GPG Key ID: D36F789E45745D17
1 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{{- $.Scratch.Add "index" slice -}} {{- $index := slice -}}
{{- range .Site.RegularPages -}} {{- range .Site.RegularPages -}}
{{ $section := .Site.GetPage "section" .Section }} {{ $section := .Site.GetPage "section" .Section }}
{{- $.Scratch.Add "index" (dict "date" (.Date | time.Format (.Site.Language.Params.dateFormat | default ":date_long")) "title" .Title "section" $section.Title "summary" .Summary "content" (.Plain | safeJS) "permalink" .Permalink) -}} {{- $index = $index | append (dict "date" (.Date | time.Format (.Site.Language.Params.dateFormat | default ":date_long")) "title" .Title "section" $section.Title "summary" .Summary "content" (.Plain | safeJS) "permalink" .RelPermalink) -}}
{{- end -}} {{- end -}}
{{- $.Scratch.Get "index" | jsonify -}} {{- $index | jsonify -}}