Skip to content

Commit

Permalink
更换搜索插件
Browse files Browse the repository at this point in the history
  • Loading branch information
zhihuaiwen committed Jan 26, 2024
1 parent 8de920a commit b6cc3c8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
13 changes: 0 additions & 13 deletions docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import {defineUserConfig} from "vuepress";
import theme from "./theme.js";
import {commentPlugin} from "vuepress-plugin-comment2";
import {mdEnhancePlugin} from "vuepress-plugin-md-enhance";
import {searchProPlugin} from "vuepress-plugin-search-pro";
import {cut} from "nodejs-jieba";

export default defineUserConfig({
dest: "./dist",
Expand All @@ -21,17 +19,6 @@ export default defineUserConfig({
// 启用图片大小
imgSize: true,
}),
//加强中文搜索
searchProPlugin({
// 配置选项
// 索引全部内容
indexContent: true,
indexOptions: {
// 使用 nodejs-jieba 进行分词
tokenize: (text, fieldName) =>
fieldName === "id" ? [text] : cut(text, true),
},
}),
// https://plugin-comment2.vuejs.press/zh/config/giscus.html#darktheme
commentPlugin({
provider: "Giscus",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"dependencies": {
"@vuepress/client": "2.0.0-rc.0",
"@vuepress/utils": "2.0.0-rc.0",
"@vuepress/plugin-search": "2.0.0-rc.0",
"husky": "8.0.3",
"markdownlint-cli2": "0.11.0",
"mathjax-full": "3.2.2",
"nano-staged": "0.8.0",
"vuepress-plugin-search-pro": "2.0.0-rc.13",
"nodejs-jieba": "0.1.2",
"prettier": "3.1.1",
"vue": "^3.4.13",
Expand Down

0 comments on commit b6cc3c8

Please sign in to comment.