From 2ffe55a86ae530f8bd626dd440f678bc7d42853d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20Cora=C3=A7=C3=A3o?= Date: Thu, 27 Jun 2024 23:05:51 +0100 Subject: [PATCH] fix https://github.com/nunocoracao/blowfish/issues/1563 --- assets/js/search.js | 2 +- layouts/_default/index.json | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/assets/js/search.js b/assets/js/search.js index d95dba3a..c3e7adbc 100644 --- a/assets/js/search.js +++ b/assets/js/search.js @@ -166,7 +166,7 @@ function executeQuery(term) {
${title}
-
${value.item.section}·${value.item.date}
+
${value.item.section}·${value.item.date? value.item.date : ""}
${value.item.summary}
diff --git a/layouts/_default/index.json b/layouts/_default/index.json index 7fbcfe26..b301c8d6 100644 --- a/layouts/_default/index.json +++ b/layouts/_default/index.json @@ -5,7 +5,8 @@ {{ end }} {{- range $pages -}} {{- $section := .Site.GetPage "section" .Section -}} - {{- $index = $index | append (dict + {{- if .Date -}} + {{- $index = $index | append (dict "date" (.Date | time.Format (.Site.Language.Params.dateFormat | default ":date_long")) "title" (.Title | emojify | safeJS) "section" ($section.Title | emojify | safeJS) @@ -14,6 +15,17 @@ "permalink" .RelPermalink "externalUrl" .Params.externalUrl "type" .Type - ) -}} + ) -}} + {{- else -}} + {{- $index = $index | append (dict + "title" (.Title | emojify | safeJS) + "section" ($section.Title | emojify | safeJS) + "summary" (.Summary | safeJS) + "content" (.Plain | safeJS) + "permalink" .RelPermalink + "externalUrl" .Params.externalUrl + "type" .Type + ) -}} + {{- end -}} {{- end -}} {{- $index | jsonify -}} \ No newline at end of file