@ver5/vitepress-plugin-search
v1.0.7
Published
Provide local search to your documentation site.
Downloads
3
Readme
Provides local search to your documentation site
修改自: flexsearch。 修改了部分选项。
Installing
npm i vitepress-plugin-search flexsearch -D
Add the plugin
- Using an vite.config file
//vite.config.ts
import { SearchPlugin } from 'vitepress-plugin-search';
import { defineConfig } from 'vite';
//default options
var options = {
...flexSearchIndexOptions,
previewLength: 62,
buttonLabel: 'Search',
placeholder: 'Search docs',
allow: [],
ignore: [],
separator: ' ',
showLogo: true
};
export default defineConfig({
plugins: [SearchPlugin(options)]
});
- Using config.js or config.ts
import { SearchPlugin } from 'vitepress-plugin-search';
import { defineConfig } from 'vitepress';
export default defineConfig({
vite: { plugins: [SearchPlugin(options)] }
});
Options
Accept FlexSearch Index Options
Multi language support
Provided by flexsearch