Files
congo-hindi-gujarati/layouts/_default/index.json
T
Uwe Schmidt 7afb18671b Respect showDate in search results
Also hide date for list pages, which don't have their date shown in the theme.
2023-03-24 13:49:09 +01:00

15 lines
599 B
JSON

{{- $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.Language.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 -}}