🔀 Merge pull request #511 from uschmidt83/search-dates

 Respect `showDate` in search results
This commit is contained in:
James Panther
2023-03-29 15:09:16 +11:00
committed by GitHub
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -1,8 +1,9 @@
{{- $index := slice -}}
{{- range .Site.Pages -}}
{{- $section := .Site.GetPage "section" .Section -}}
{{- $showDate := .Params.showDate | default .Site.Params.article.showDate -}}
{{- $index = $index | append (dict
"date" (.Date | time.Format (.Site.Language.Params.dateFormat | default ":date_long"))
"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)