Skip to content

Commit

Permalink
fix: 解决搜索结果路径存在next问题
Browse files Browse the repository at this point in the history
  • Loading branch information
yushijie1 committed Dec 30, 2024
1 parent 5369860 commit bee3753
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ const siteConfig = {
searchParameters: {
// facetFilters: [`version: ${versions[0]}`],
},
replaceSearchResultPathname: {
from: '/next/',
to: '/',
},
},
announcementBar: {
id: 'support_us', // Any value that will identify this message.
Expand Down
8 changes: 4 additions & 4 deletions src/pages/versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function Version () {
const context = useDocusaurusContext()
const { siteConfig = {} } = context
const latestVersion = versions[0]
const taroNextVersions = versions.filter(version => version.startsWith('3'))
const taroNextVersions = versions.filter(version => version.startsWith('5'))
const pastVersions = versions.filter((version) => version !== latestVersion && !taroNextVersions.includes(version))
const repoUrl = `https://github.com/${siteConfig.organizationName}/${siteConfig.projectName}`
return (
Expand All @@ -40,15 +40,15 @@ function Version () {
</Link>
</td>
<td>
<a href={`${repoUrl}/releases/tag/v${latestVersion}`}>
<a href={`${repoUrl}/releases`}>
更新日志
</a>
</td>
</tr>
</tbody>
</table>
</div>
<div className="margin-bottom--lg">
{/* <div className="margin-bottom--lg">
<h3 id="next">最新进度 (未发布版本)</h3>
<p>你能够在这里看到最新的文档和未发布的代码。</p>
<table>
Expand All @@ -66,7 +66,7 @@ function Version () {
</tr>
</tbody>
</table>
</div>
</div> */}
{/* {taroNextVersions.length > 0 && (
<div className="margin-bottom--lg">
<h3 id="archive">Taro Next</h3>
Expand Down
2 changes: 1 addition & 1 deletion versions.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
["3.x", "2.x", "1.x"]
["current", "3.x", "2.x", "1.x"]

0 comments on commit bee3753

Please sign in to comment.