From 02b7cdb0547f9c9a6311ec71573101cdb3abf3e6 Mon Sep 17 00:00:00 2001 From: Dominic Reich Date: Sun, 23 Jul 2023 18:15:17 +0200 Subject: [PATCH] add updated date to json feed --- layouts/_default/index.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 layouts/_default/index.json diff --git a/layouts/_default/index.json b/layouts/_default/index.json new file mode 100644 index 0000000..931afc1 --- /dev/null +++ b/layouts/_default/index.json @@ -0,0 +1,16 @@ +{{- $index := slice -}} +{{- range .Site.Pages -}} + {{- $section := .Site.GetPage "section" .Section -}} + {{- $showDate := .Params.showDate | default .Site.Params.article.showDate -}} + {{- $index = $index | append (dict + "date" (cond (and .IsPage $showDate) (.Date | time.Format (site.Params.dateFormat | default ":date_long")) nil) + "updated" (cond (and .IsPage $showDate) (.Lastmod | time.Format (site.Params.dateFormat | default ":date_long")) nil) + "title" (.Title | emojify | safeJS) + "section" ($section.Title | emojify | safeJS) + "summary" (.Summary | emojify | safeJS) + "content" (.Plain | emojify | safeJS) + "permalink" .RelPermalink + ) -}} +{{- end -}} +{{- $index | jsonify -}} +