summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--exampleSite/config.toml2
-rw-r--r--layouts/_default/index.json5
2 files changed, 7 insertions, 0 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 72e22b7..7df8ba0 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -2,6 +2,8 @@ baseURL = "https://example.com"
title = "Hugo Theme Fuji"
theme = "fuji"
+[outputs]
+ home = ["html", "rss", "json"]
hasCJKLanguage = true
enableEmoji = true
enableRobotsTXT = true
diff --git a/layouts/_default/index.json b/layouts/_default/index.json
new file mode 100644
index 0000000..a823e62
--- /dev/null
+++ b/layouts/_default/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 "contents" .Plain "permalink" .Permalink) -}}
+{{- end -}}
+{{- $.Scratch.Get "search" | jsonify -}} \ No newline at end of file