Bläddra i källkod

search: refactor so that only one index is generated

George Cushen 7 år sedan
förälder
incheckning
36084c5607
3 ändrade filer med 2 tillägg och 8 borttagningar
  1. 1 7
      exampleSite/config.toml
  2. 0 0
      layouts/index.json
  3. 1 1
      layouts/partials/footer.html

+ 1 - 7
exampleSite/config.toml

@@ -37,15 +37,9 @@ defaultContentLanguageInSubdir = false
 enableGitInfo = false
 
 [outputs]
-  home = [ "HTML", "CSS", "RSS", "search" ]
+  home = [ "HTML", "CSS", "RSS", "JSON" ]
   section = [ "HTML", "RSS" ]
 
-[outputFormats.search]
-  baseName = "search"
-  isPlainText = true
-  mediaType = "application/json"
-  notAlternative = true
-
 # Configure BlackFriday Markdown rendering.
 #   See: https://gohugo.io/getting-started/configuration/#configure-blackfriday
 [blackfriday]

+ 0 - 0
layouts/_default/list.search.json → layouts/index.json


+ 1 - 1
layouts/partials/footer.html

@@ -66,7 +66,7 @@
     {{ if ne .Site.Params.search.engine 0 }}
     {{/* Configure search engine. */}}
     <script>
-      const search_index_filename = {{ "/search.json" | relURL }};
+      const search_index_filename = {{ "/index.json" | relURL }};
       const i18n = {
         'placeholder': {{ i18n "search_placeholder" }},
         'no_results': {{ i18n "search_no_results" }}