From e9ce1e32147c7f890103fb9321db7bb89588cdce Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Thu, 3 Feb 2022 11:46:21 +1100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20JSON=20output=20duplicated?= =?UTF-8?q?=20items?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layouts/_default/index.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/layouts/_default/index.json b/layouts/_default/index.json index 8d4ac99a..789b95c5 100644 --- a/layouts/_default/index.json +++ b/layouts/_default/index.json @@ -1,6 +1,6 @@ -{{- $.Scratch.Add "index" slice -}} +{{- $index := slice -}} {{- range .Site.RegularPages -}} {{ $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 -}} -{{- $.Scratch.Get "index" | jsonify -}} +{{- $index | jsonify -}}