From 5e466ea5e61b1082fc802f55a6f55cc42b15393e Mon Sep 17 00:00:00 2001 From: xugaoyi <894072666@qq.com> Date: Tue, 4 Jan 2022 21:40:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=8D=A2=E5=85=A8=E6=96=87?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/.vuepress/config.ts | 53 +++++++++++++++++--------------- docs/.vuepress/styles/index.styl | 8 +++++ package.json | 3 +- 3 files changed, 38 insertions(+), 26 deletions(-) diff --git a/docs/.vuepress/config.ts b/docs/.vuepress/config.ts index cb2d244..4bb0b1f 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -236,32 +236,35 @@ export default defineConfig4CustomTheme({ hm: baiduCode, }, + // 全文搜索 + 'fulltext-search': {}, + // 可以添加第三方搜索链接的搜索框(继承原官方搜索框的配置参数) - 'thirdparty-search': { - thirdparty: [ - { - title: '在MDN中搜索', - frontUrl: 'https://developer.mozilla.org/zh-CN/search?q=', // 搜索链接的前面部分 - behindUrl: '', // 搜索链接的后面部分,可选,默认 '' - }, - { - title: '在Runoob中搜索', - frontUrl: 'https://www.runoob.com/?s=', - }, - { - title: '在Vue API中搜索', - frontUrl: 'https://cn.vuejs.org/v2/api/#', - }, - { - title: '在Bing中搜索', - frontUrl: 'https://cn.bing.com/search?q=', - }, - { - title: '通过百度搜索本站的', - frontUrl: 'https://www.baidu.com/s?wd=site%3Axugaoyi.com%20', - }, - ], - }, + // 'thirdparty-search': { + // thirdparty: [ + // { + // title: '在MDN中搜索', + // frontUrl: 'https://developer.mozilla.org/zh-CN/search?q=', // 搜索链接的前面部分 + // behindUrl: '', // 搜索链接的后面部分,可选,默认 '' + // }, + // { + // title: '在Runoob中搜索', + // frontUrl: 'https://www.runoob.com/?s=', + // }, + // { + // title: '在Vue API中搜索', + // frontUrl: 'https://cn.vuejs.org/v2/api/#', + // }, + // { + // title: '在Bing中搜索', + // frontUrl: 'https://cn.bing.com/search?q=', + // }, + // { + // title: '通过百度搜索本站的', + // frontUrl: 'https://www.baidu.com/s?wd=site%3Axugaoyi.com%20', + // }, + // ], + // }, // 代码块复制按钮 'one-click-copy': { diff --git a/docs/.vuepress/styles/index.styl b/docs/.vuepress/styles/index.styl index 756357c..925037d 100644 --- a/docs/.vuepress/styles/index.styl +++ b/docs/.vuepress/styles/index.styl @@ -57,3 +57,11 @@ body .vuepress-plugin-demo-block__wrapper border-bottom-color: $accentColor !important; svg fill: $accentColor !important; + +// 全文搜索框 +.suggestions + overflow: auto + max-height: calc(100vh - 6rem) + .highlight + color: $accentColor + font-weight: bold diff --git a/package.json b/package.json index 6dfbd0c..e8da90f 100644 --- a/package.json +++ b/package.json @@ -15,10 +15,11 @@ "dayjs": "^1.9.7", "inquirer": "^7.1.0", "json2yaml": "^1.1.0", - "vuepress": "1.9.2", + "vuepress": "1.9.5", "vuepress-plugin-baidu-autopush": "^1.0.1", "vuepress-plugin-baidu-tongji": "^1.0.1", "vuepress-plugin-demo-block": "^0.7.2", + "vuepress-plugin-fulltext-search": "^2.2.1", "vuepress-plugin-one-click-copy": "^1.0.2", "vuepress-plugin-thirdparty-search": "^1.0.2", "vuepress-plugin-zooming": "^1.1.7",