emersonbottero / vitepress-plugin-search

Provide local search to your documentation site.
MIT License
239 stars 30 forks source link

How do I configure Vitepress-plugin-search? #17

Closed Charles7c closed 1 year ago

Charles7c commented 1 year ago

Now, if I want to change the default configuration, do I do it this way?

import { defineConfig } from 'vite'
import { SearchPlugin } from 'vitepress-plugin-search'

export default defineConfig({
  plugins: [
    SearchPlugin({
      //Add a wildcard at the end of the search
      wildcard: false,
      //The length of the result search preview item
      previewLength: 62,
    })
  ]
})

In addition, I have two small suggestions: 1.Can local search not work after I configure Algolia? 2.Can the local search style be optimized to be more similar to Algolia, so that it is insensitive when switching between Algolia and 'vitepress-plugin-search'?

image image

fyzhu commented 1 year ago

Is your problem solved? how to use this plugin?

fyzhu commented 1 year ago

Is your problem solved? how to use this plugin?

problem solved put vite.config.js into folder docs