0%

Integrating Search into the NexT Theme


1. NexT’s Third-Party Search Integrations

According to the official documentation, the NexT theme framework supports four search methods:

  • SwiftType
  • Micro Search
  • Local Search
  • Algolia

Local Search is the simplest and most convenient option. Here’s how to set it up.

  • Install the hexo-generator-searchdb plugin:

    1
    npm install hexo-generator-searchdb --save
  • Add the following configuration to your site config file:

    1
    2
    3
    4
    5
    search:
    path: search.xml
    field: post
    format: html
    limit: 10000
  • Enable local search in your theme config file:

    1
    2
    3
    4
    # Local Search
    # Dependencies: https://github.com/theme-next/hexo-generator-searchdb
    local_search:
    enable: true

After deploying the blog, head to the homepage — you’ll see a search button:

Use the search feature to find all Spring-related posts:

Local Search supports both title and full-text search, making it genuinely useful out of the box.

扫描二维码分享