瀏覽代碼

Enable search widget in Academic 2.4

Xi Ruoyao 7 年之前
父節點
當前提交
fc99fd0aa3
共有 2 個文件被更改,包括 27 次插入1 次删除
  1. 15 1
      config.toml
  2. 12 0
      content/home/search.md

+ 15 - 1
config.toml

@@ -22,9 +22,15 @@ defaultContentLanguageInSubdir = false
 enableGitInfo = true
 
 [outputs]
-  home = [ "HTML", "CSS", "RSS" ]
+  home = [ "HTML", "CSS", "RSS", "search" ]
   section = [ "HTML", "RSS" ]
 
+[outputFormats.search]
+  baseName = "search"
+  isPlainText = true
+  mediaType = "application/json"
+  notAlternative = true
+
 # Configure BlackFriday Markdown rendering.
 #   See: https://gohugo.io/readfiles/bfconfig/
 [blackfriday]
@@ -259,6 +265,14 @@ enableGitInfo = true
   url = "#contact"
   weight = 6
 
+[[menu.main]]
+  name = "Search"
+  url = "#search"
+  weight = 10
+
+  [params.search]
+    engine = 1
+
 # Taxonomies.
 [taxonomies]
   tag = "tags"

+ 12 - 0
content/home/search.md

@@ -0,0 +1,12 @@
++++
+# Search widget.
+widget = "search"
+active = true
+date = 2018-07-23T00:00:00
+
+title = "Search"
+subtitle = ""
+
+# Order that this section will appear in.
+weight = 75
++++