Skip to Content
GuidesSet Up Search

Set Up Search

Theme Cupertino uses Pagefind for searching. Search features are disabled initially because it requires to be set up.

Enable in configuration

_config.cupertino.yml
search: true

Install Pagefind

npm install pagefind

Add script

package.json
{ "scripts": { "index": "pagefind --site public" } }

Build index

npm run build npm run index

You have to build before indexing, or there will be nothing to index. You should also adjust your deployment commands or CI/CD.

Create search page

npm exec hexo new page 'search'
source/search/index.md
--- type: search ---

Done! Now your search page is ready at /search.

Last updated on