search: - path: search.xml + path: search.json field: post content: true format: html
path:生成搜尋檔案的路徑,預設 search.xml,如果檔案副檔名為 .json,則輸出格式為 JSON。 否則將匯出 XML 格式檔案。
field:搜尋範圍,預設 post,只搜尋發佈的文章。
content:是否搜尋文章的內容
format:頁面內容的形式
設定主題 NexT
themes\next\_config.yml
1 2 3 4 5 6 7 8 9 10 11
# Local search # Dependencies: https://github.com/next-theme/hexo-generator-searchdb local_search: - enable: false + enable: true # Show top n results per article, show all results by setting to -1 top_n_per_article: 1 # Unescape html strings to the readable one. unescape: false # Preload the search data when the page loads. preload: false