Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emersonbottero/vitepress-plugin-search
Provide local search to your documentation site.
https://github.com/emersonbottero/vitepress-plugin-search
Last synced: 3 months ago
JSON representation
Provide local search to your documentation site.
- Host: GitHub
- URL: https://github.com/emersonbottero/vitepress-plugin-search
- Owner: emersonbottero
- License: mit
- Created: 2022-05-14T03:32:55.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-05T04:21:27.000Z (about 1 year ago)
- Last Synced: 2024-10-22T14:32:12.737Z (3 months ago)
- Language: Vue
- Size: 1.13 MB
- Stars: 240
- Watchers: 5
- Forks: 30
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-vitepress-v1 - Local Search with Flexsearch - Local search to your documentation site using [Flexsearch](https://github.com/nextapps-de/flexsearch) (:electric_plug: Plugins / Community Plugins)
README
## Provides local search to your documentation site
Uses [flexsearch](https://github.com/nextapps-de/flexsearch).
## Installing
```js
npm i vitepress-plugin-search flexsearch -D
```## Add the plugin
- Using an vite.config file
```js
//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: [],
};export default defineConfig({
plugins: [SearchPlugin(options)],
});
```- Using config.js or config.ts
```js
import { SearchPlugin } from "vitepress-plugin-search";
import { defineConfig } from "vitepress";
export default defineConfig({
vite: { plugins: [SearchPlugin(options)] }
});
```## Options
Accept [FlexSearch Index Options](https://github.com/nextapps-de/flexsearch#options)
## Multi language support
Provided by flexsearch
See [chinese settings for example](https://github.com/emersonbottero/vitepress-plugin-search/issues/11)