Skip to main content

Search

Published:

Series: Documentation

  1. 1. Introduction
  2. 2. Getting Started
  3. 3. Color Schemes
  4. 4. Directory Structure and Assets
  5. 5. Feature Images
  6. 6. Favicon
  7. 7. Series
  8. 8. Archive
  9. 9. Search
  10. 10. Backlinks
  11. 11. Related Article
  12. 12. Rich Content
  13. 13. Markdown and Hugo
  14. 14. Customization
  15. 15. Reference - Configuration
  16. 16. Reference - Front matter
  17. 17. Reference - Icons

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: true

Search 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
Info

To exclude specific pages from the search index, use the pageNoList parameter in that page's front matter.

Keyboard Shortcuts

  • /, Ctrl + K or Cmd + K to open the search modal.
  • Esc to close.
  • ArrowUp and ArrowDown to navigate

Search Scope & Weighting

The search module indexes all the regular pages, following fields with decreasing priority:

  1. Title (Highest weight)
  2. Summary & Headings
  3. Content (Lowest weight)

Series: Documentation

  1. 1. Introduction
  2. 2. Getting Started
  3. 3. Color Schemes
  4. 4. Directory Structure and Assets
  5. 5. Feature Images
  6. 6. Favicon
  7. 7. Series
  8. 8. Archive
  9. 9. Search
  10. 10. Backlinks
  11. 11. Related Article
  12. 12. Rich Content
  13. 13. Markdown and Hugo
  14. 14. Customization
  15. 15. Reference - Configuration
  16. 16. Reference - Front matter
  17. 17. Reference - Icons