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: trueInstall Pagefind
npm install pagefindAdd script
package.json
{
"scripts": {
"index": "pagefind --site public"
}
}Build index
npm run build
npm run indexYou 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