Enable search feature

This commit is contained in:
Masterain
2023-01-12 05:11:33 -08:00
parent 21b512b893
commit 428bf6b067
3 changed files with 213 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
import { defineUserConfig } from "vuepress";
import { viteBundler } from '@vuepress/bundler-vite'
import theme from "./theme.js";
import { searchProPlugin } from "vuepress-plugin-search-pro";
export default defineUserConfig({
base: "/",
@@ -26,6 +27,21 @@ export default defineUserConfig({
},
},
plugins: [
searchProPlugin({
indexContent: true,
customFields:[
{
getter: (page) => page.frontmatter.category,
formatter: {
"/": "分类: $content",
"/en/": "Category$content",
},
},
]
})
],
theme,
shouldPrefetch: false,