Search
首次發表:
Yore built-in search utilizes Fuse.js to provide client-side indexing and real-time search results.
Configuration
To enable search functionality, you must configure both the global parameters and the Hugo output formats. Ensure the search feature is toggled on:
hugo.yaml
params:
searchEnabled: trueSearch requires a JSON index to function. Update your hugo.yaml to generate the fuse-search output for the home page:
hugo.yaml
outputs:
home:
- HTML
- RSS
- fuse-search
outputFormats:
fuse-search:
mediaType: application/json
baseName: fuse-search
isPlainText: true
notAlternative: true
weight: 10信息
To exclude specific pages from the search index, use the pageNoList parameter in that page's front matter.
Keyboard Shortcuts
/,Ctrl + KorCmd + Kto open the search modal.Escto close.ArrowUpandArrowDownto navigate
Search Scope & Weighting
The search module indexes all the regular pages, following fields with decreasing priority:
- Title (Highest weight)
- Summary & Headings
- Content (Lowest weight)