summaryrefslogtreecommitdiffstats
path: root/layouts/index.json
diff options
context:
space:
mode:
authoramzrk22020-07-24 09:11:02 +0800
committeramzrk22020-07-24 09:11:02 +0800
commitfa1c6b5ae768ef619e9ced7419a60f66e5010007 (patch)
tree79480be341245335eaf6474c2bc04029fe489966 /layouts/index.json
parent0c502fd74ff7898624f87a402161527802d5b2bb (diff)
downloadhugo-theme-fuji-fa1c6b5ae768ef619e9ced7419a60f66e5010007.tar.gz
hugo-theme-fuji-fa1c6b5ae768ef619e9ced7419a60f66e5010007.tar.bz2
hugo-theme-fuji-fa1c6b5ae768ef619e9ced7419a60f66e5010007.zip
Fix search index relative link issue
Diffstat (limited to 'layouts/index.json')
-rw-r--r--layouts/index.json5
1 files changed, 5 insertions, 0 deletions
diff --git a/layouts/index.json b/layouts/index.json
new file mode 100644
index 0000000..e582dda
--- /dev/null
+++ b/layouts/index.json
@@ -0,0 +1,5 @@
+{{- $.Scratch.Add "search" slice -}}
+{{- range (where .Site.RegularPages "Type" "in" .Site.Params.mainSections) -}}
+ {{- $.Scratch.Add "search" (dict "title" .Title "tags" .Params.tags "content" .Plain "permalink" .Permalink "date" (.Date.Format "2006-01-02")) -}}
+{{- end -}}
+{{- $.Scratch.Get "search" | jsonify -}} \ No newline at end of file