Skip to content

Commit e08a3a0

Browse files
committed
fix: fix dead links, and reverse ver select menu
1 parent 1bd3e7f commit e08a3a0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

docs/.vitepress/theme/upgrading/UpgradingHelper.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ function update() {
5757
to: nowTo.value
5858
};
5959
window.location.hash = `#${nowUpgradingInfo.value.from}-${nowUpgradingInfo.value.to}`;
60-
fromOptions.value = getVersionsBefore(nowUpgradingInfo.value.to);
61-
toOptions.value = getVersionsAfter(nowUpgradingInfo.value.from);
60+
fromOptions.value = getVersionsBefore(nowUpgradingInfo.value.to).reverse();
61+
toOptions.value = getVersionsAfter(nowUpgradingInfo.value.from).reverse();
6262
nowChanges.value = getChanges(nowUpgradingInfo.value);
6363
const changes = nowChanges.value.map(change => `${change.from}-to-${change.to}`);
6464
document.querySelectorAll('.upgrading-parts-container div').forEach(ele => {

docs/.vitepress/theme/upgrading/injectUpgradingPartsPlugin.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export const injectUpgradingPartsPlugin = (md: MarkdownIt) => {
1212
${state.src.replace(INJECT_UPGRADING_PARTS, upgradingInfos
1313
.map(info => {
1414
const targetPartFile = `./docs/en/upgrading-parts/${info.from}-to-${info.to}.md`;
15-
const targetPartContent = fs.readFileSync(targetPartFile, 'utf-8');
15+
const targetPartContent = fs.readFileSync(targetPartFile, 'utf-8')
16+
.replace(new RegExp("]\\(\\.\\./", 'g'), "](./");
1617
return `
1718
<div id="${info.from}-to-${info.to}" class="default-hide">
1819

0 commit comments

Comments
 (0)