Skip to content

Commit a847ea5

Browse files
authored
Fix search (#1104)
* Fixed search Fixed the 404 error when redirecting from the homepage. Fixed the issue of non-standard links within Markdown. * 1 * 1
1 parent 55f39ae commit a847ea5

19 files changed

Lines changed: 445 additions & 407 deletions

File tree

docusaurus.config.js

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,14 @@ module.exports = {
108108
"protobuf",
109109
],
110110
},
111-
algolia: {
112-
// apiKey: "5f882bef2dfc81f5f1b4e5ea87b2f165",
113-
appId: 'DY1AXAPBQY',
114-
apiKey: '391ef440955a44a32cbeb5e7db9a2b6c',
115-
indexName: "apache_shenyu",
116-
// Optional: see doc section below
117-
contextualSearch: true,
118-
},
111+
// algolia: {
112+
// // apiKey: "5f882bef2dfc81f5f1b4e5ea87b2f165",
113+
// appId: 'DY1AXAPBQY',
114+
// apiKey: '391ef440955a44a32cbeb5e7db9a2b6c',
115+
// indexName: "apache_shenyu",
116+
// // Optional: see doc section below
117+
// contextualSearch: true,
118+
// },
119119
imageZoom: {
120120
// CSS selector to apply the plugin to, defaults to '.markdown img'
121121
selector: '.markdown img',
@@ -153,6 +153,37 @@ module.exports = {
153153
],
154154
],
155155
plugins: [
156+
[
157+
require.resolve("@easyops-cn/docusaurus-search-local"),
158+
{
159+
hashed: true,
160+
language: ["en", "zh"],
161+
highlightSearchTermsOnTargetPage: true,
162+
explicitSearchResultPath: true,
163+
indexDocs: true,
164+
indexBlog: true,
165+
indexPages: true,
166+
docsRouteBasePath: [
167+
"/docs",
168+
"/community",
169+
"/event",
170+
"/shenyuNginx",
171+
"/shenyuClientGolang",
172+
"/shenyuClientDotnet",
173+
"/shenyuClientRust",
174+
"/helm",
175+
],
176+
blogRouteBasePath: ["/blog", "/news"],
177+
searchResultLimits: 8,
178+
searchResultContextMaxLength: 50,
179+
// 忽略某些不需要索引的元素
180+
ignoreFiles: [
181+
/node_modules/,
182+
/\.docusaurus/,
183+
/build/,
184+
],
185+
},
186+
],
156187
[
157188
"@docusaurus/plugin-content-docs",
158189
{

i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/security/casdoor.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ ShenYu 有Casdoor插件去使用Casdoor
1414

1515
在成功部署之后,我们需要确保:
1616

17-
* Casdoor服务成功在 **http://localhost:8000**上运行
17+
* Casdoor服务成功在 [http://localhost:8000](http://localhost:8000)上运行
1818

19-
* 打开你喜爱的浏览器浏览 **http://localhost:7001**,你可以看到Casdoor的登陆页面
19+
* 打开你喜爱的浏览器浏览 [http://localhost:7001](http://localhost:7001),你可以看到Casdoor的登陆页面
2020

2121
* 输入`admin``123`去测试登录是否成功
2222

i18n/zh/docusaurus-plugin-content-docs/current/user-guide/admin-usage/api-document.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ description: API文档管理
3232
>
3333
> 字典名称:表示网关类型,比如填写 `测试环境``生产环境`。该值将会出现在API文档详情页面;
3434
>
35-
> 字典值:表示网关地址,比如 http://127.0.0.1:9195。该值将会出现在API文档详情页面;
35+
> 字典值:表示网关地址,比如 [http://localhost:9195](http://localhost:9195)。该值将会出现在API文档详情页面;
3636
>
3737
> 字典描述或备注:该网关地址用于何种场景,做一个简短描述。该值将会出现在API文档详情页面;
3838
>

i18n/zh/docusaurus-plugin-content-docs/version-2.5.1/plugin-center/security/casdoor.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ ShenYu 有Casdoor插件去使用Casdoor
1414

1515
在成功部署之后,我们需要确保:
1616

17-
* Casdoor服务成功在 **http://localhost:8000**上运行
17+
* Casdoor服务成功在 [http://localhost:8000](http://localhost:8000)上运行
1818

19-
* 打开你喜爱的浏览器浏览 **http://localhost:7001**,你可以看到Casdoor的登陆页面
19+
* 打开你喜爱的浏览器浏览 [http://localhost:7001](http://localhost:7001),你可以看到Casdoor的登陆页面
2020

2121
* 输入`admin``123`去测试登录是否成功
2222

i18n/zh/docusaurus-plugin-content-docs/version-2.6.0/plugin-center/security/casdoor.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ ShenYu 有Casdoor插件去使用Casdoor
1414

1515
在成功部署之后,我们需要确保:
1616

17-
* Casdoor服务成功在 **http://localhost:8000**上运行
17+
* Casdoor服务成功在 [http://localhost:8000](http://localhost:8000)上运行
1818

19-
* 打开你喜爱的浏览器浏览 **http://localhost:7001**,你可以看到Casdoor的登陆页面
19+
* 打开你喜爱的浏览器浏览 [http://localhost:7001](http://localhost:7001),你可以看到Casdoor的登陆页面
2020

2121
* 输入`admin``123`去测试登录是否成功
2222

i18n/zh/docusaurus-plugin-content-docs/version-2.6.0/user-guide/admin-usage/api-document.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ description: API文档管理
3232
>
3333
> 字典名称:表示网关类型,比如填写 `测试环境``生产环境`。该值将会出现在API文档详情页面;
3434
>
35-
> 字典值:表示网关地址,比如 http://127.0.0.1:9195。该值将会出现在API文档详情页面;
35+
> 字典值:表示网关地址,比如 [http://localhost:9195](http://localhost:9195)。该值将会出现在API文档详情页面;
3636
>
3737
> 字典描述或备注:该网关地址用于何种场景,做一个简短描述。该值将会出现在API文档详情页面;
3838
>

i18n/zh/docusaurus-plugin-content-docs/version-2.6.1/plugin-center/security/casdoor.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ ShenYu 有Casdoor插件去使用Casdoor
1414

1515
在成功部署之后,我们需要确保:
1616

17-
* Casdoor服务成功在 **http://localhost:8000**上运行
17+
* Casdoor服务成功在 [http://localhost:8000](http://localhost:8000)上运行
1818

19-
* 打开你喜爱的浏览器浏览 **http://localhost:7001**,你可以看到Casdoor的登陆页面
19+
* 打开你喜爱的浏览器浏览 [http://localhost:7001](http://localhost:7001),你可以看到Casdoor的登陆页面
2020

2121
* 输入`admin``123`去测试登录是否成功
2222

i18n/zh/docusaurus-plugin-content-docs/version-2.6.1/user-guide/admin-usage/api-document.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ description: API文档管理
3232
>
3333
> 字典名称:表示网关类型,比如填写 `测试环境``生产环境`。该值将会出现在API文档详情页面;
3434
>
35-
> 字典值:表示网关地址,比如 http://127.0.0.1:9195。该值将会出现在API文档详情页面;
35+
> 字典值:表示网关地址,比如 [http://localhost:9195](http://localhost:9195)。该值将会出现在API文档详情页面;
3636
>
3737
> 字典描述或备注:该网关地址用于何种场景,做一个简短描述。该值将会出现在API文档详情页面;
3838
>

i18n/zh/docusaurus-plugin-content-docs/version-2.7.0.1/plugin-center/security/casdoor.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ ShenYu 有Casdoor插件去使用Casdoor
1414

1515
在成功部署之后,我们需要确保:
1616

17-
* Casdoor服务成功在 **http://localhost:8000**上运行
17+
* Casdoor服务成功在 [http://localhost:8000](http://localhost:8000)上运行
1818

19-
* 打开你喜爱的浏览器浏览 **http://localhost:7001**,你可以看到Casdoor的登陆页面
19+
* 打开你喜爱的浏览器浏览 [http://localhost:7001](http://localhost:7001),你可以看到Casdoor的登陆页面
2020

2121
* 输入`admin``123`去测试登录是否成功
2222

i18n/zh/docusaurus-plugin-content-docs/version-2.7.0.1/user-guide/admin-usage/api-document.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ description: API文档管理
3232
>
3333
> 字典名称:表示网关类型,比如填写 `测试环境``生产环境`。该值将会出现在API文档详情页面;
3434
>
35-
> 字典值:表示网关地址,比如 http://127.0.0.1:9195。该值将会出现在API文档详情页面;
35+
> 字典值:表示网关地址,比如 [http://localhost:9195](http://localhost:9195)。该值将会出现在API文档详情页面;
3636
>
3737
> 字典描述或备注:该网关地址用于何种场景,做一个简短描述。该值将会出现在API文档详情页面;
3838
>

0 commit comments

Comments
 (0)