Skip to content

Commit bee3753

Browse files
author
yushijie1
committed
fix: 解决搜索结果路径存在next问题
1 parent 5369860 commit bee3753

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

docusaurus.config.js

+4
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ const siteConfig = {
110110
searchParameters: {
111111
// facetFilters: [`version: ${versions[0]}`],
112112
},
113+
replaceSearchResultPathname: {
114+
from: '/next/',
115+
to: '/',
116+
},
113117
},
114118
announcementBar: {
115119
id: 'support_us', // Any value that will identify this message.

src/pages/versions.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function Version () {
1818
const context = useDocusaurusContext()
1919
const { siteConfig = {} } = context
2020
const latestVersion = versions[0]
21-
const taroNextVersions = versions.filter(version => version.startsWith('3'))
21+
const taroNextVersions = versions.filter(version => version.startsWith('5'))
2222
const pastVersions = versions.filter((version) => version !== latestVersion && !taroNextVersions.includes(version))
2323
const repoUrl = `https://github.com/${siteConfig.organizationName}/${siteConfig.projectName}`
2424
return (
@@ -40,15 +40,15 @@ function Version () {
4040
</Link>
4141
</td>
4242
<td>
43-
<a href={`${repoUrl}/releases/tag/v${latestVersion}`}>
43+
<a href={`${repoUrl}/releases`}>
4444
更新日志
4545
</a>
4646
</td>
4747
</tr>
4848
</tbody>
4949
</table>
5050
</div>
51-
<div className="margin-bottom--lg">
51+
{/* <div className="margin-bottom--lg">
5252
<h3 id="next">最新进度 (未发布版本)</h3>
5353
<p>你能够在这里看到最新的文档和未发布的代码。</p>
5454
<table>
@@ -66,7 +66,7 @@ function Version () {
6666
</tr>
6767
</tbody>
6868
</table>
69-
</div>
69+
</div> */}
7070
{/* {taroNextVersions.length > 0 && (
7171
<div className="margin-bottom--lg">
7272
<h3 id="archive">Taro Next</h3>

versions.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
["3.x", "2.x", "1.x"]
1+
["current", "3.x", "2.x", "1.x"]

0 commit comments

Comments
 (0)