mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.Docs.git
synced 2025-11-19 21:16:31 +08:00
Enable search feature
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { defineUserConfig } from "vuepress";
|
import { defineUserConfig } from "vuepress";
|
||||||
import { viteBundler } from '@vuepress/bundler-vite'
|
import { viteBundler } from '@vuepress/bundler-vite'
|
||||||
import theme from "./theme.js";
|
import theme from "./theme.js";
|
||||||
|
import { searchProPlugin } from "vuepress-plugin-search-pro";
|
||||||
|
|
||||||
export default defineUserConfig({
|
export default defineUserConfig({
|
||||||
base: "/",
|
base: "/",
|
||||||
@@ -26,6 +27,21 @@ export default defineUserConfig({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
plugins: [
|
||||||
|
searchProPlugin({
|
||||||
|
indexContent: true,
|
||||||
|
customFields:[
|
||||||
|
{
|
||||||
|
getter: (page) => page.frontmatter.category,
|
||||||
|
formatter: {
|
||||||
|
"/": "分类: $content",
|
||||||
|
"/en/": "Category:$content",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
})
|
||||||
|
],
|
||||||
|
|
||||||
theme,
|
theme,
|
||||||
|
|
||||||
shouldPrefetch: false,
|
shouldPrefetch: false,
|
||||||
|
|||||||
196
package-lock.json
generated
196
package-lock.json
generated
@@ -12,6 +12,7 @@
|
|||||||
"@vuepress/client": "2.0.0-beta.60",
|
"@vuepress/client": "2.0.0-beta.60",
|
||||||
"vue": "^3.2.29",
|
"vue": "^3.2.29",
|
||||||
"vuepress": "^2.0.0-beta.60",
|
"vuepress": "^2.0.0-beta.60",
|
||||||
|
"vuepress-plugin-search-pro": "^2.0.0-beta.156",
|
||||||
"vuepress-theme-hope": "^2.0.0-beta.154"
|
"vuepress-theme-hope": "^2.0.0-beta.154"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -8139,6 +8140,148 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/vuepress-plugin-search-pro": {
|
||||||
|
"version": "2.0.0-beta.156",
|
||||||
|
"resolved": "https://registry.npmjs.org/vuepress-plugin-search-pro/-/vuepress-plugin-search-pro-2.0.0-beta.156.tgz",
|
||||||
|
"integrity": "sha512-SefiVZySCpx9QZ03XBMnn9mBsH30BUCUAT/zbapbj6qY3Hk/8p8iqBl3guEKb5MuCJJF/YtXPc9zfxLXvYWfXg==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@vuepress/client": "2.0.0-beta.60",
|
||||||
|
"@vuepress/shared": "2.0.0-beta.60",
|
||||||
|
"@vuepress/utils": "2.0.0-beta.60",
|
||||||
|
"@vueuse/core": "^9.10.0",
|
||||||
|
"body-scroll-lock": "^3.1.5",
|
||||||
|
"cheerio": "1.0.0-rc.12",
|
||||||
|
"chokidar": "^3.5.3",
|
||||||
|
"vue": "^3.2.45",
|
||||||
|
"vue-router": "^4.1.6",
|
||||||
|
"vuepress-plugin-sass-palette": "2.0.0-beta.156",
|
||||||
|
"vuepress-shared": "2.0.0-beta.156"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^14.18.0 || >=16.0.0",
|
||||||
|
"npm": ">=8",
|
||||||
|
"pnpm": ">=7"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@vuepress/client": "2.0.0-beta.60",
|
||||||
|
"sass-loader": "^13.2.0",
|
||||||
|
"vuepress": "2.0.0-beta.60",
|
||||||
|
"vuepress-plugin-sass-palette": "2.0.0-beta.156",
|
||||||
|
"vuepress-shared": "2.0.0-beta.156",
|
||||||
|
"vuepress-vite": "2.0.0-beta.60",
|
||||||
|
"vuepress-webpack": "2.0.0-beta.60"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@vuepress/client": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"sass-loader": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"vuepress": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"vuepress-plugin-sass-palette": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"vuepress-shared": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"vuepress-vite": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"vuepress-webpack": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/vuepress-plugin-search-pro/node_modules/vuepress-plugin-sass-palette": {
|
||||||
|
"version": "2.0.0-beta.156",
|
||||||
|
"resolved": "https://registry.npmjs.org/vuepress-plugin-sass-palette/-/vuepress-plugin-sass-palette-2.0.0-beta.156.tgz",
|
||||||
|
"integrity": "sha512-oI0n5k88wx/4molae/LAOmGKn/7Iw7DSX6JLN2+91azTtyNNwrqAbhmqC94O+nNW1Hs22qI5JhEBPlEeuFtyNA==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@vuepress/shared": "2.0.0-beta.60",
|
||||||
|
"@vuepress/utils": "2.0.0-beta.60",
|
||||||
|
"chokidar": "^3.5.3",
|
||||||
|
"sass": "^1.57.1",
|
||||||
|
"vuepress-shared": "2.0.0-beta.156"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^14.18.0 || >=16.0.0",
|
||||||
|
"npm": ">=8",
|
||||||
|
"pnpm": ">=7"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"sass-loader": "^13.2.0",
|
||||||
|
"vuepress": "2.0.0-beta.60",
|
||||||
|
"vuepress-shared": "2.0.0-beta.156",
|
||||||
|
"vuepress-vite": "2.0.0-beta.60",
|
||||||
|
"vuepress-webpack": "2.0.0-beta.60"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"sass-loader": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"vuepress": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"vuepress-shared": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"vuepress-vite": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"vuepress-webpack": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/vuepress-plugin-search-pro/node_modules/vuepress-shared": {
|
||||||
|
"version": "2.0.0-beta.156",
|
||||||
|
"resolved": "https://registry.npmjs.org/vuepress-shared/-/vuepress-shared-2.0.0-beta.156.tgz",
|
||||||
|
"integrity": "sha512-RlUdwqPybhgcTiAZRznk438T+i8Nxs6rh+Z4RjAo1WOdthBbDhsqcZ/V136gv7XL4dCJLJtTPyu1WAnyM4zcww==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@vuepress/client": "2.0.0-beta.60",
|
||||||
|
"@vuepress/shared": "2.0.0-beta.60",
|
||||||
|
"@vuepress/utils": "2.0.0-beta.60",
|
||||||
|
"cheerio": "1.0.0-rc.12",
|
||||||
|
"dayjs": "^1.11.7",
|
||||||
|
"execa": "^6.1.0",
|
||||||
|
"fflate": "^0.7.4",
|
||||||
|
"gray-matter": "^4.0.3",
|
||||||
|
"striptags": "^3.2.0",
|
||||||
|
"vue": "^3.2.45",
|
||||||
|
"vue-router": "^4.1.6"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "^14.18.0 || >=16.0.0",
|
||||||
|
"npm": ">=8",
|
||||||
|
"pnpm": ">=7"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@vuepress/client": "2.0.0-beta.60",
|
||||||
|
"vuepress": "2.0.0-beta.60",
|
||||||
|
"vuepress-vite": "2.0.0-beta.60",
|
||||||
|
"vuepress-webpack": "2.0.0-beta.60"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@vuepress/client": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"vuepress": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"vuepress-vite": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"vuepress-webpack": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/vuepress-plugin-seo2": {
|
"node_modules/vuepress-plugin-seo2": {
|
||||||
"version": "2.0.0-beta.154",
|
"version": "2.0.0-beta.154",
|
||||||
"resolved": "https://registry.npmjs.org/vuepress-plugin-seo2/-/vuepress-plugin-seo2-2.0.0-beta.154.tgz",
|
"resolved": "https://registry.npmjs.org/vuepress-plugin-seo2/-/vuepress-plugin-seo2-2.0.0-beta.154.tgz",
|
||||||
@@ -14588,6 +14731,59 @@
|
|||||||
"vuepress-shared": "2.0.0-beta.154"
|
"vuepress-shared": "2.0.0-beta.154"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"vuepress-plugin-search-pro": {
|
||||||
|
"version": "2.0.0-beta.156",
|
||||||
|
"resolved": "https://registry.npmjs.org/vuepress-plugin-search-pro/-/vuepress-plugin-search-pro-2.0.0-beta.156.tgz",
|
||||||
|
"integrity": "sha512-SefiVZySCpx9QZ03XBMnn9mBsH30BUCUAT/zbapbj6qY3Hk/8p8iqBl3guEKb5MuCJJF/YtXPc9zfxLXvYWfXg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@vuepress/client": "2.0.0-beta.60",
|
||||||
|
"@vuepress/shared": "2.0.0-beta.60",
|
||||||
|
"@vuepress/utils": "2.0.0-beta.60",
|
||||||
|
"@vueuse/core": "^9.10.0",
|
||||||
|
"body-scroll-lock": "^3.1.5",
|
||||||
|
"cheerio": "1.0.0-rc.12",
|
||||||
|
"chokidar": "^3.5.3",
|
||||||
|
"vue": "^3.2.45",
|
||||||
|
"vue-router": "^4.1.6",
|
||||||
|
"vuepress-plugin-sass-palette": "2.0.0-beta.156",
|
||||||
|
"vuepress-shared": "2.0.0-beta.156"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"vuepress-plugin-sass-palette": {
|
||||||
|
"version": "2.0.0-beta.156",
|
||||||
|
"resolved": "https://registry.npmjs.org/vuepress-plugin-sass-palette/-/vuepress-plugin-sass-palette-2.0.0-beta.156.tgz",
|
||||||
|
"integrity": "sha512-oI0n5k88wx/4molae/LAOmGKn/7Iw7DSX6JLN2+91azTtyNNwrqAbhmqC94O+nNW1Hs22qI5JhEBPlEeuFtyNA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@vuepress/shared": "2.0.0-beta.60",
|
||||||
|
"@vuepress/utils": "2.0.0-beta.60",
|
||||||
|
"chokidar": "^3.5.3",
|
||||||
|
"sass": "^1.57.1",
|
||||||
|
"vuepress-shared": "2.0.0-beta.156"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"vuepress-shared": {
|
||||||
|
"version": "2.0.0-beta.156",
|
||||||
|
"resolved": "https://registry.npmjs.org/vuepress-shared/-/vuepress-shared-2.0.0-beta.156.tgz",
|
||||||
|
"integrity": "sha512-RlUdwqPybhgcTiAZRznk438T+i8Nxs6rh+Z4RjAo1WOdthBbDhsqcZ/V136gv7XL4dCJLJtTPyu1WAnyM4zcww==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@vuepress/client": "2.0.0-beta.60",
|
||||||
|
"@vuepress/shared": "2.0.0-beta.60",
|
||||||
|
"@vuepress/utils": "2.0.0-beta.60",
|
||||||
|
"cheerio": "1.0.0-rc.12",
|
||||||
|
"dayjs": "^1.11.7",
|
||||||
|
"execa": "^6.1.0",
|
||||||
|
"fflate": "^0.7.4",
|
||||||
|
"gray-matter": "^4.0.3",
|
||||||
|
"striptags": "^3.2.0",
|
||||||
|
"vue": "^3.2.45",
|
||||||
|
"vue-router": "^4.1.6"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"vuepress-plugin-seo2": {
|
"vuepress-plugin-seo2": {
|
||||||
"version": "2.0.0-beta.154",
|
"version": "2.0.0-beta.154",
|
||||||
"resolved": "https://registry.npmjs.org/vuepress-plugin-seo2/-/vuepress-plugin-seo2-2.0.0-beta.154.tgz",
|
"resolved": "https://registry.npmjs.org/vuepress-plugin-seo2/-/vuepress-plugin-seo2-2.0.0-beta.154.tgz",
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
"@vuepress/client": "2.0.0-beta.60",
|
"@vuepress/client": "2.0.0-beta.60",
|
||||||
"vue": "^3.2.29",
|
"vue": "^3.2.29",
|
||||||
"vuepress": "^2.0.0-beta.60",
|
"vuepress": "^2.0.0-beta.60",
|
||||||
|
"vuepress-plugin-search-pro": "^2.0.0-beta.156",
|
||||||
"vuepress-theme-hope": "^2.0.0-beta.154"
|
"vuepress-theme-hope": "^2.0.0-beta.154"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user