💡 WIP: First working version, no configuration provided!
Provide local search to your documentation site using lunr.
It works for standard vitepress docs using the doc folder.
Getting Started
Basic Steps to make it work!
Installing
npm i vitepress-plugin-search -D
Setup
- Since we are using the same slot as the default algolia search let's create an alias so our component is used instead
import { defineConfig } from "vite";
export default defineConfig({
resolve: {
alias: {
"./components/AlgoliaSearchBox.vue":
"vitepress-plugin-search/src/Search.vue",
},
},
});
- Add an algolia entry just to pass the v-if in the slots
themeConfig: {
...
algolia: {},
...
}
"prebuild": "npm run index",
"index": "node ./node_modules/vitepress-plugin-search/src/index.js"
💡 alternatively you can create an script like
"build": "npm run index && vitepress build docs && npm run index && vitepress build docs",