From 9d5dcf84e5495353c986021eafa714a785e09749 Mon Sep 17 00:00:00 2001 From: luckyasme <807254037@qq.com> Date: Fri, 12 Sep 2025 17:07:59 +0800 Subject: [PATCH 1/5] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E9=94=9A=E7=82=B9?= =?UTF-8?q?=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/.vitepress/config.ts | 4 ++++ .../src/components/markdown/MarkdownTitle.vue | 8 ++++---- app/.vitepress/src/layouts/LayoutDoc.vue | 3 ++- app/.vitepress/src/utils/common.ts | 3 ++- .../src/views/docs/TheDocsArticle.vue | 6 +++++- package.json | 1 - pnpm-lock.yaml | 17 ----------------- scripts/gen-toc.js | 13 +++++++++++-- 8 files changed, 28 insertions(+), 27 deletions(-) diff --git a/app/.vitepress/config.ts b/app/.vitepress/config.ts index 15183f1..fdb9a2a 100644 --- a/app/.vitepress/config.ts +++ b/app/.vitepress/config.ts @@ -1,4 +1,5 @@ import type Markdown from 'markdown-it'; +import { getDomId } from './src/utils/common'; export default { base: '/', @@ -57,6 +58,9 @@ export default { light: 'light-plus', dark: 'dark-plus', }, + anchor: { + slugify: (s: string) => `user-content-${getDomId(s)}` + }, config: (md: Markdown) => { // 处理须知/说明/警告/注意 md.core.ruler.before('normalize', 'replace-old-alerts', (state) => { diff --git a/app/.vitepress/src/components/markdown/MarkdownTitle.vue b/app/.vitepress/src/components/markdown/MarkdownTitle.vue index d1af3dc..4b83acd 100644 --- a/app/.vitepress/src/components/markdown/MarkdownTitle.vue +++ b/app/.vitepress/src/components/markdown/MarkdownTitle.vue @@ -38,25 +38,25 @@ const onMouseLeave = () => { }; const onClickAnchor = () => { - if (`#${props.titleId}` === decodeURIComponent(hash.value)) { + if (`#${props.titleId.replace('user-content-', '')}` === decodeURIComponent(hash.value)) { const contentDom = document.querySelector('.ly-doc'); if (contentDom) { const hash = decodeURIComponent(window.location.hash); - const target = contentDom.querySelector(hash) || contentDom.querySelector(`[name='${hash.slice(1)}']`); + const target = contentDom.querySelector(`#${props.titleId}`) || contentDom.querySelector(hash) || contentDom.querySelector(`[name='${hash.slice(1)}']`); const scrollContainer = document.querySelector('#app > .o-scroller > .o-scroller-container'); if (target && scrollContainer) { scrollIntoView(target, scrollContainer); } } } else { - window.history.replaceState({}, '', `#${props.titleId}`); + window.history.replaceState({}, '', `#${props.titleId.replace('user-content-', '')}`); window.dispatchEvent(new HashChangeEvent('hashchange')); } }; const onClickCopyLink = (e: MouseEvent) => { useClipboard({ - text: `${window.location.origin}${window.location.pathname}#${props.titleId}`, + text: `${window.location.origin}${window.location.pathname}#${props.titleId.replace('user-content-', '')}`, target: e, success: () => { message.success({ diff --git a/app/.vitepress/src/layouts/LayoutDoc.vue b/app/.vitepress/src/layouts/LayoutDoc.vue index 5c209e8..bbdc1eb 100644 --- a/app/.vitepress/src/layouts/LayoutDoc.vue +++ b/app/.vitepress/src/layouts/LayoutDoc.vue @@ -149,7 +149,7 @@ const scrollIntoTitle = async () => { const contentDom = document.querySelector('.ly-doc'); if (contentDom) { const hash = decodeURIComponent(window.location.hash); - const target = contentDom.querySelector(hash) || contentDom.querySelector(`[name='${hash.slice(1)}']`); + const target = contentDom.querySelector(`#user-content-${hash.slice(1)}`) || contentDom.querySelector(hash) || contentDom.querySelector(`[name='${hash.slice(1)}']`); const scrollContainer = document.querySelector('#app > .o-scroller > .o-scroller-container'); if (target && scrollContainer) { await scrollIntoView(target, scrollContainer); @@ -445,6 +445,7 @@ onUnmounted(() => { @change-anchor="onChangeAnchor" @page-change="onPageChange" @update-menu-expaned="updateExpandedKeys" + @click-hash-link="scrollIntoTitle" /> diff --git a/app/.vitepress/src/utils/common.ts b/app/.vitepress/src/utils/common.ts index 5914f54..acbaa5d 100644 --- a/app/.vitepress/src/utils/common.ts +++ b/app/.vitepress/src/utils/common.ts @@ -147,5 +147,6 @@ export function getVersionFromUrl(url: string) { * 获取转义后的dom id */ export function getDomId(str: string) { - return str.replace(/[ &]/g, '-'); + const regex = /[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FF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DD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g + return str.toLowerCase().replace(regex, '').replace(/ /g, '-'); } diff --git a/app/.vitepress/src/views/docs/TheDocsArticle.vue b/app/.vitepress/src/views/docs/TheDocsArticle.vue index dc4f603..dedafcb 100644 --- a/app/.vitepress/src/views/docs/TheDocsArticle.vue +++ b/app/.vitepress/src/views/docs/TheDocsArticle.vue @@ -13,6 +13,7 @@ const emits = defineEmits<{ (evt: 'update-menu-expaned'): void; (evt: 'change-anchor', value: string): void; (evt: 'page-change', type: 'prev' | 'next'): void; + (evt: 'click-hash-link'): void; }>(); const viewStore = useViewStore(); @@ -68,7 +69,7 @@ const onScrollUpdateAnchor = () => { const [_, hash] = item.href.split('#'); const id = decodeURIComponent(hash); - const target = contentDom.querySelector(`#${id}`); + const target = contentDom.querySelector(`#user-content-${id}`); if (!target) { continue; } @@ -123,6 +124,9 @@ const onClickContent = (evt: PointerEvent) => { if (evt.target && (evt.target as HTMLLinkElement)?.tagName === 'A') { setTimeout(() => { emits('update-menu-expaned'); + if ((evt.target as HTMLLinkElement).href?.includes('#')) { + emits('click-hash-link'); + } }, 200); } }; diff --git a/package.json b/package.json index f9d0505..e946ade 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,6 @@ }, "devDependencies": { "@eslint/js": "^9.29.0", - "@mdit-vue/shared": "^2.1.3", "@rushstack/eslint-patch": "^1.3.3", "@tsconfig/node18": "^18.2.2", "@types/highlight.js": "^10.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c8db9d2..69f4a97 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -58,9 +58,6 @@ importers: '@eslint/js': specifier: ^9.29.0 version: 9.29.0 - '@mdit-vue/shared': - specifier: ^2.1.3 - version: 2.1.3 '@rushstack/eslint-patch': specifier: ^1.3.3 version: 1.10.5 @@ -650,12 +647,6 @@ packages: '@jridgewell/trace-mapping@0.3.25': resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} - '@mdit-vue/shared@2.1.3': - resolution: {integrity: sha512-27YI8b0VVZsAlNwaWoaOCWbr4eL8B04HxiYk/y2ktblO/nMcOEOLt4p0RjuobvdyUyjHvGOS09RKhq7qHm1CHQ==} - - '@mdit-vue/types@2.1.0': - resolution: {integrity: sha512-TMBB/BQWVvwtpBdWD75rkZx4ZphQ6MN0O4QB2Bc0oI5PC2uE57QerhNxdRZ7cvBHE2iY2C+BUNUziCfJbjIRRA==} - '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -3228,14 +3219,6 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.0 - '@mdit-vue/shared@2.1.3': - dependencies: - '@mdit-vue/types': 2.1.0 - '@types/markdown-it': 14.1.2 - markdown-it: 14.1.0 - - '@mdit-vue/types@2.1.0': {} - '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5 diff --git a/scripts/gen-toc.js b/scripts/gen-toc.js index 59649ca..1ede4cb 100644 --- a/scripts/gen-toc.js +++ b/scripts/gen-toc.js @@ -6,7 +6,6 @@ import matter from 'gray-matter'; import markdownIt from 'markdown-it'; import markdownItAnchor from 'markdown-it-anchor'; import yaml from 'js-yaml'; -import { slugify } from '@mdit-vue/shared'; import { getGitUrlInfo } from './utils/git.js'; import { getBranchName } from './utils/common.js'; @@ -58,6 +57,16 @@ function getMarkdownOrignalContent(str) { .replace(/`/g, ''); // 去除反引号 } +/** + * 获取标签 id + * @param {string} title 标题 + * @returns {string} 返回标题 id + */ +export function getMarkdownTitleId(title) { + const regex = /[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDE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E6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g + return title.toLowerCase().replace(regex, '').replace(/ /g, '-'); +} + /** * 转换 href 链接 * @param {string} href 链接 @@ -104,7 +113,7 @@ function getTitleNodes(filePath, parentHref) { const md = markdownIt().use(markdownItAnchor, { permalink: false, level: [2], - slugify: (str) => slugify(getMarkdownOrignalContent(str)), + slugify: (str) => getMarkdownTitleId(getMarkdownOrignalContent(str)), }); const tokens = md.parse(markdownContent, {}); -- Gitee From b6de6b29e00bb20e0440efd1d4f1ea2cf8a3da55 Mon Sep 17 00:00:00 2001 From: luckyasme <807254037@qq.com> Date: Fri, 12 Sep 2025 17:12:12 +0800 Subject: [PATCH 2/5] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/config/new-version.js | 8 +++++++- scripts/dev.js | 2 +- scripts/merge-upstream.js | 27 ++++++++++++++++----------- scripts/merge.js | 4 ++-- 4 files changed, 26 insertions(+), 15 deletions(-) diff --git a/scripts/config/new-version.js b/scripts/config/new-version.js index cdcd1c2..0bc0cd4 100644 --- a/scripts/config/new-version.js +++ b/scripts/config/new-version.js @@ -1 +1,7 @@ -export default ['stable-common', 'stable-25.03', 'stable-24.03_LTS_SP1', 'stable-24.03_LTS_SP2']; +export default { + 'stable-common': 'common', + 'master': '25.09', + 'stable-25.03': '25.03', + 'stable-24.03_LTS_SP1': '24.03_LTS_SP1', + 'stable-24.03_LTS_SP2': '24.03_LTS_SP2', +}; diff --git a/scripts/dev.js b/scripts/dev.js index 14654f5..7347bad 100644 --- a/scripts/dev.js +++ b/scripts/dev.js @@ -24,7 +24,7 @@ function execCommand(command) { (async () => { let versions = process.argv.slice(2); if (versions.length === 0) { - versions = NEW_VERSONS; + versions = Object.keys(NEW_VERSONS); } await execCommand(`pnpm pre-dev ${versions.join(' ')}`); diff --git a/scripts/merge-upstream.js b/scripts/merge-upstream.js index 0d27421..62e75b9 100644 --- a/scripts/merge-upstream.js +++ b/scripts/merge-upstream.js @@ -8,17 +8,22 @@ import { copyDirectorySync } from './utils/file.js'; const REPO_DIR = path.join(process.cwd(), '../../'); const copyRepoFromDiskCache = async (upstream, dir, storagePath) => { - const { repo, branch, locations } = getGitUrlInfo(upstream); - const cachePath = path.join(REPO_DIR, repo); - if (!isGitRepo(cachePath)) { - console.log(`不存在 ${repo} 仓库缓存,跳过~`); - } + try { + const { repo, branch, locations } = getGitUrlInfo(upstream); + const cachePath = path.join(REPO_DIR, repo); + if (!isGitRepo(cachePath)) { + console.log(`不存在 ${repo} 仓库缓存,跳过~`); + } - await checkoutBranch(cachePath, branch); - const sourceDir = path.join(cachePath, ...locations.slice(0, -1)); - const destDir = storagePath ? path.join(dir, storagePath) : path.join(dir, repo, ...locations.slice(2, -1)); - copyDirectorySync(sourceDir, destDir); - console.log('复制完成'); + await checkoutBranch(cachePath, branch); + const sourceDir = path.join(cachePath, ...locations.slice(0, -1)); + const destDir = storagePath ? path.join(dir, storagePath) : path.join(dir, repo, ...locations.slice(2, -1)); + copyDirectorySync(sourceDir, destDir); + console.log('复制完成'); + } catch (err) { + console.error(`copyRepoFromDiskCache error: ${err?.message}, upstream: ${upstream}`); + process.exit(1); + } }; const scanYaml = async (yamlPath, dir) => { @@ -64,7 +69,7 @@ if (args.length === 0) { console.error('请提供分支名称'); process.exit(1); } else { - if (NEW_VERSONS.includes(args[0])) { + if (Object.keys(NEW_VERSONS).includes(args[0])) { merge(args[0]); } else { console.error('非新版本内容,跳过处理~'); diff --git a/scripts/merge.js b/scripts/merge.js index b9ac6f7..fa4979e 100644 --- a/scripts/merge.js +++ b/scripts/merge.js @@ -182,7 +182,7 @@ const copyContentToDir = (originDir, destDir) => { * @param {string} branch 分支 */ const normalizeContent = async (buildPath, branch) => { - const branchName = getBranchName(branch); + const branchName = NEW_VERSONS[branch] || getBranchName(branch); // 复制website-vitepress内容到build目录 await copyContentToDir(path.join(REPO_DIR, 'website-vitepress'), buildPath); @@ -334,7 +334,7 @@ const merge = async (branch, source) => { // 处理内容 try { - if (NEW_VERSONS.includes(branch)) { + if (Object.keys(NEW_VERSONS).includes(branch)) { await checkGitRepo(REPO_DOCS_DIR); await normalizeContent(buildPath, branch); } else { -- Gitee From 240f5b6ebc834f2361c27fe04abd9841bbe38772 Mon Sep 17 00:00:00 2001 From: luckyasme <807254037@qq.com> Date: Tue, 16 Sep 2025 11:38:59 +0800 Subject: [PATCH 3/5] feat: 25.09 --- Dockerfile | 2 +- app/.vitepress/src/config/version.ts | 8 ++ app/.vitepress/src/utils/common.ts | 1 + deploy/nginx/nginx.portal.conf | 23 ++++ package.json | 2 +- scripts/merge-redirect.js | 151 +++++++++++++++++++++++++++ scripts/merge-upstream.js | 25 ++++- scripts/merge.js | 18 ++-- tests/common.test.ts | 2 +- 9 files changed, 222 insertions(+), 10 deletions(-) create mode 100644 scripts/merge-redirect.js diff --git a/Dockerfile b/Dockerfile index 8c01d1c..89491c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,7 @@ COPY --from=NginxBuilder /etc/nginx/geoip /etc/nginx/geoip COPY --from=NginxBuilder /etc/nginx/mime.types /etc/nginx/mime.types COPY --from=Builder /home/openeuler/docs/app/.vitepress/dist /usr/share/nginx/www/ COPY ./deploy/monitor.sh ./deploy/entrypoint.sh /etc/nginx/ -COPY ./deploy/nginx/nginx.conf /etc/nginx/nginx.conf.template +COPY --from=Builder /home/openeuler/docs/deploy/nginx/nginx.conf /etc/nginx/nginx.conf.template RUN sed -i "s|repo.openeuler.org|mirrors.nju.edu.cn/openeuler|g" /etc/yum.repos.d/openEuler.repo \ && sed -i '/metalink/d' /etc/yum.repos.d/openEuler.repo \ diff --git a/app/.vitepress/src/config/version.ts b/app/.vitepress/src/config/version.ts index 5b38f2f..1c89b44 100644 --- a/app/.vitepress/src/config/version.ts +++ b/app/.vitepress/src/config/version.ts @@ -1,5 +1,9 @@ export const versions = { zh: [ + { + label: '25.09', + value: '25.09', + }, { label: '24.03 LTS SP2', value: '24.03_LTS_SP2', @@ -116,6 +120,10 @@ export const versions = { }, ], en: [ + { + label: '25.09', + value: '25.09', + }, { label: '24.03 LTS SP2', value: '24.03_LTS_SP2', diff --git a/app/.vitepress/src/utils/common.ts b/app/.vitepress/src/utils/common.ts index acbaa5d..7ba8b5d 100644 --- a/app/.vitepress/src/utils/common.ts +++ b/app/.vitepress/src/utils/common.ts @@ -125,6 +125,7 @@ export function getGiteeUrl(node: DocMenuNodeT | null) { const [_, lang, __, branch, ...others] = pathname.split('/'); const map: Record = { common: 'stable-common', + '25.09': 'master', '25.03': 'stable-25.03', '24.03_LTS_SP1': 'stable-24.03_LTS_SP1', '24.03_LTS_SP2': 'stable-24.03_LTS_SP2', diff --git a/deploy/nginx/nginx.portal.conf b/deploy/nginx/nginx.portal.conf index 582f1e4..e70196b 100644 --- a/deploy/nginx/nginx.portal.conf +++ b/deploy/nginx/nginx.portal.conf @@ -175,6 +175,29 @@ http { proxy_pass https://message-center.openeuler.org/server/; } + # ============ 25.09 ============ + + location /assets/25.09/ { + proxy_set_header X-Forwarded-For $http_x_real_ip; + proxy_set_header Connection ""; + + proxy_pass https://openeuler-docs-website-stable2-25-09.openeuler-website-docs:8080; + } + + location /zh/docs/25.09/ { + proxy_set_header X-Forwarded-For $http_x_real_ip; + proxy_set_header Connection ""; + + proxy_pass https://openeuler-docs-website-stable2-25-09.openeuler-website-docs:8080; + } + + location /en/docs/25.09/ { + proxy_set_header X-Forwarded-For $http_x_real_ip; + proxy_set_header Connection ""; + + proxy_pass https://openeuler-docs-website-stable2-25-09.openeuler-website-docs:8080; + } + # ============ 25.03 ============ location /assets/25.03/ { diff --git a/package.json b/package.json index e946ade..c883478 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "gen-toc": "node scripts/gen-toc.js", "dev": "vitepress dev app", "dev2": "node scripts/dev.js", - "build": "node scripts/gen-toc.js $VERSION && vitepress build app", + "build": "node scripts/gen-toc.js $VERSION && node scripts/merge-redirect.js $VERSION && vitepress build app", "preview": "vitepress preview app", "format": "prettier --write app/.vitepress/src/", "type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false", diff --git a/scripts/merge-redirect.js b/scripts/merge-redirect.js new file mode 100644 index 0000000..e3e44b2 --- /dev/null +++ b/scripts/merge-redirect.js @@ -0,0 +1,151 @@ +import path from 'path'; +import fs from 'fs'; +import yaml from 'js-yaml'; + +import NEW_VERSONS from './config/new-version.js'; +import { getBranchName } from './utils/common.js'; +import { getGitUrlInfo } from './utils/git.js'; + +const __dirname = path.resolve(); +const tocZhPath = path.join(__dirname, './app/.vitepress/public/toc/toc.json'); +const tocEnPath = path.join(__dirname, './app/.vitepress/public/toc/toc-en.json'); +const cachePath = path.join(__dirname, '.cache'); +const nginxPath = path.join(__dirname, './deploy/nginx/nginx.conf'); + +const reversedRedirectMap = {}; +const outputRedirectMap = {}; + +function getRepoReversedRedirect(repoName) { + try { + if (reversedRedirectMap[repoName]) { + return reversedRedirectMap[repoName]; + } + + const yamlPath = path.join(cachePath, `_redirect-${repoName}.yaml`); + if (!fs.existsSync(yamlPath)) { + return; + } + + reversedRedirectMap[repoName] = {}; + const obj = yaml.load(fs.readFileSync(yamlPath, 'utf-8')); + Object.keys(obj).forEach((key) => { + reversedRedirectMap[repoName][obj[key]] = key; + }); + + return reversedRedirectMap[repoName]; + } catch (err) { + console.log(`getRepoReversedRedirect 异常: ${err?.message}`); + } +} + +function processSelfRedirect() { + const versions = process.argv.slice(2); + if (versions.length === 0) { + return; + } + + versions.forEach((version) => { + const branchName = NEW_VERSONS[version] || getBranchName(version); + const yamlPath = path.join(cachePath, `_redirect-${branchName}.yaml`); + if (!fs.existsSync(yamlPath)) { + return; + } + + try { + const obj = yaml.load(fs.readFileSync(yamlPath, 'utf-8')); + Object.keys(obj).forEach((key) => { + if (key.trim() === obj[key].trim()) { + return; + } + + const [_, oldLang, ...oldPath] = key.trim().split('/'); + const [__, newLang, ...newPath] = obj[key].trim().split('/'); + const oldHref = `/${oldLang}/docs/${branchName}/${oldPath.join('/')}`.replace('.md', '.html'); + const newHref = `/${newLang}/docs/${branchName}/${newPath.join('/')}`.replace('.md', '.html'); + outputRedirectMap[oldHref] = newHref; + }); + } catch (err) { + console.log(`processSelfRedirect 异常: ${err?.message}`); + } + }); +} + +function processToc(toc) { + if (Array.isArray(toc.sections)) { + toc.sections.forEach(processToc); + } + + if (toc.type !== 'page' || !toc.href || !toc.upstream) { + return; + } + + const { repo, locations } = getGitUrlInfo(toc.upstream); + + const repoRedirectMap = getRepoReversedRedirect(repo); + if (!repoRedirectMap) { + return; + } + + const localPath = `/${locations.join('/')}`; + if (!repoRedirectMap[localPath]) { + return; + } + + const hrefArr = toc.href.split('/'); + const newPathArr = [...locations]; + newPathArr[newPathArr.length - 1] = newPathArr[newPathArr.length - 1].replace('.md', '.html'); + while (hrefArr[hrefArr.length - 1] && newPathArr[newPathArr.length - 1] && hrefArr[hrefArr.length - 1] === newPathArr[newPathArr.length - 1]) { + hrefArr.pop(); + newPathArr.pop(); + } + + const newPathPrefix = `/${newPathArr.join('/')}`; + const oldHref = `${hrefArr.join('/')}${repoRedirectMap[localPath].replace(newPathPrefix, '')}`.replace('.md', '.html').trim(); + if (oldHref === toc.href.trim()) { + return; + } + + outputRedirectMap[oldHref] = toc.href.trim(); +} + +// 增加旧版本转发 +function replaceCommonNginxRedirect(obj) { + try { + const rewrites = []; + Object.keys(obj).forEach((key) => { + const oldUrl = key.replace(/([.*+?^${}()|[\]\\])/g, '\\$1').replace(/ /g, '\\s'); + rewrites.push(`rewrite ^${oldUrl}$ ${obj[key]} permanent;`); + }); + + const nginxContent = fs.readFileSync(nginxPath, 'utf8').replace('#[rewrite_template]', rewrites.join('\n ')); + fs.writeFileSync(nginxPath, nginxContent, 'utf8'); + console.log(nginxContent); + console.log(`替换nginx转发成功`); + } catch (err) { + console.log(`替换nginx转发内容失败,错误原因:${err?.message}`); + } +} + +function main() { + processSelfRedirect(); + + try { + const tocZh = JSON.parse(fs.readFileSync(tocZhPath, 'utf-8') || '[]'); + tocZh.forEach(processToc); + } catch (err) { + console.log(`转换redirect异常 - zh: ${err?.message}`); + } + + try { + const tocEn = JSON.parse(fs.readFileSync(tocEnPath, 'utf-8') || '[]'); + tocEn.forEach(processToc); + } catch (err) { + console.log(`转换redirect异常 - en: ${err?.message}`); + } + + console.log('_redirect.yaml 文件转换完成'); + console.log(JSON.stringify(outputRedirectMap, null, 2)); + replaceCommonNginxRedirect(outputRedirectMap); +} + +main(); diff --git a/scripts/merge-upstream.js b/scripts/merge-upstream.js index 62e75b9..b460661 100644 --- a/scripts/merge-upstream.js +++ b/scripts/merge-upstream.js @@ -1,11 +1,12 @@ import fs from 'fs'; import path from 'path'; -import NEW_VERSONS from './config/new-version.js' +import NEW_VERSONS from './config/new-version.js'; import { getGitUrlInfo, isGitRepo, checkoutBranch } from './utils/git.js'; import { copyDirectorySync } from './utils/file.js'; const REPO_DIR = path.join(process.cwd(), '../../'); +const relativeRepo = new Set(); const copyRepoFromDiskCache = async (upstream, dir, storagePath) => { try { @@ -15,6 +16,7 @@ const copyRepoFromDiskCache = async (upstream, dir, storagePath) => { console.log(`不存在 ${repo} 仓库缓存,跳过~`); } + relativeRepo.add(cachePath.replace(/\\/g, '/')); await checkoutBranch(cachePath, branch); const sourceDir = path.join(cachePath, ...locations.slice(0, -1)); const destDir = storagePath ? path.join(dir, storagePath) : path.join(dir, repo, ...locations.slice(2, -1)); @@ -57,11 +59,32 @@ const mergeUpstream = async (targetPath) => { } }; +const copyRedirectYaml = async (buildPath) => { + for (const repoPath of relativeRepo) { + if (!fs.existsSync(`${repoPath}/docs/_redirect.yaml`) && !fs.existsSync(`${repoPath}/doc/_redirect.yaml`)) { + continue; + } + + if (!fs.existsSync(`${buildPath}/.cache/`)) { + fs.mkdirSync(`${buildPath}/.cache/`, { + recursive: true, + }); + } + + if (fs.existsSync(`${repoPath}/docs/_redirect.yaml`)) { + fs.copyFileSync(`${repoPath}/docs/_redirect.yaml`, `${buildPath}/.cache/_redirect-${repoPath.split('/').pop()}.yaml`); + } else { + fs.copyFileSync(`${repoPath}/doc/_redirect.yaml`, `${buildPath}/.cache/_redirect-${repoPath.split('/').pop()}.yaml`); + } + } +}; + const merge = async (branch) => { const buildPath = path.join(process.cwd(), `../../../build/${branch}`); await mergeUpstream(`${buildPath}/app/zh/`); await mergeUpstream(`${buildPath}/app/en/`); + copyRedirectYaml(buildPath); }; const args = process.argv.slice(2); diff --git a/scripts/merge.js b/scripts/merge.js index fa4979e..951a481 100644 --- a/scripts/merge.js +++ b/scripts/merge.js @@ -226,7 +226,7 @@ const normalizeContent = async (buildPath, branch) => { let packageJson = fs.readFileSync(`${buildPath}/package.json`, 'utf8'); if (packageJson) { - packageJson = packageJson.replace('$VERSION', branchName); + packageJson = packageJson.replaceAll('$VERSION', branchName); fs.writeFileSync(`${buildPath}/package.json`, packageJson, 'utf8'); } @@ -250,6 +250,17 @@ const normalizeContent = async (buildPath, branch) => { await copyContentToDir(`${REPO_DOCS_DIR}/docs/en/`, `${buildPath}/app/en/docs/${branchName}/`); } + // 复制 redirect.yaml + if (fs.existsSync(`${REPO_DOCS_DIR}/_redirect.yaml`) && branchName !== 'common') { + if (!fs.existsSync(`${buildPath}/.cache/`)) { + fs.mkdirSync(`${buildPath}/.cache/`, { + recursive: true, + }); + } + + fs.copyFileSync(`${REPO_DOCS_DIR}/_redirect.yaml`, `${buildPath}/.cache/_redirect-${branchName}.yaml`); + } + // 复制配置 if (branchName !== 'common') { await checkoutBranch(REPO_DOCS_DIR, 'stable-common'); @@ -264,11 +275,6 @@ const normalizeContent = async (buildPath, branch) => { await copyContentToDir(`${REPO_DOCS_DIR}/dsl/`, `${buildPath}/app/.vitepress/public/dsl/`); console.log(`已将 dsl 复制到 public 目录下`); } - - // 增加重定向 - if (fs.existsSync(`${REPO_DOCS_DIR}/_redirect.yaml`)) { - replaceCommonNginxRedirect(buildPath, branchName); - } }; /** diff --git a/tests/common.test.ts b/tests/common.test.ts index a1f33d5..65cda6d 100644 --- a/tests/common.test.ts +++ b/tests/common.test.ts @@ -82,7 +82,7 @@ describe('getVersionFromUrl', () => { describe('getDomId', () => { it('getDomId', () => { expect(getDomId('aa bb cc')).toBe('aa-bb-cc'); - expect(getDomId('a&b')).toBe('a-b'); + expect(getDomId('a&b')).toBe('ab'); expect(getDomId('a-c')).toBe('a-c'); }); }); -- Gitee From 117bd4c82e52ddc6e6ce1fc5781c3c13d5b8f977 Mon Sep 17 00:00:00 2001 From: luckyasme <807254037@qq.com> Date: Tue, 16 Sep 2025 16:33:02 +0800 Subject: [PATCH 4/5] =?UTF-8?q?chore:=20=E5=8D=87=E7=BA=A7=E4=BE=9D?= =?UTF-8?q?=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/.vitepress/src/directives/highlight.ts | 15 - app/.vitepress/src/directives/index.ts | 8 - app/.vitepress/theme/index.ts | 6 +- package.json | 14 +- pnpm-lock.yaml | 301 ++++++++++++--------- 5 files changed, 184 insertions(+), 160 deletions(-) delete mode 100644 app/.vitepress/src/directives/highlight.ts delete mode 100644 app/.vitepress/src/directives/index.ts diff --git a/app/.vitepress/src/directives/highlight.ts b/app/.vitepress/src/directives/highlight.ts deleted file mode 100644 index 174322c..0000000 --- a/app/.vitepress/src/directives/highlight.ts +++ /dev/null @@ -1,15 +0,0 @@ -import hljs from 'highlight.js'; - -export default { - mounted(el: HTMLElement, binding: { value: boolean }) { - if (binding.value) { - hljs.configure({ - ignoreUnescapedHTML: true, - }); - const blocks: NodeList = el.querySelectorAll('pre code'); - blocks.forEach((block) => { - hljs.highlightElement(block as HTMLElement); - }); - } - }, -}; diff --git a/app/.vitepress/src/directives/index.ts b/app/.vitepress/src/directives/index.ts deleted file mode 100644 index e73e54a..0000000 --- a/app/.vitepress/src/directives/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { Directive } from 'vue'; -import vHighlight from './highlight'; - -const directives: { [key: string]: Directive } = { - highlight: vHighlight, -}; - -export default directives; diff --git a/app/.vitepress/theme/index.ts b/app/.vitepress/theme/index.ts index 78f206e..b4d0cbd 100644 --- a/app/.vitepress/theme/index.ts +++ b/app/.vitepress/theme/index.ts @@ -3,7 +3,6 @@ import { createPinia } from 'pinia'; import Layout from '@/App.vue'; import NotFound from '@/NotFound.vue'; -import directives from '@/directives'; import '@/assets/style/base.scss'; import 'element-plus/theme-chalk/src/index.scss'; @@ -31,10 +30,7 @@ export default { ADD_ATTR: ['target'], }, }); - // 指令 - Object.keys(directives).forEach((directive) => { - app.directive(directive, directives[directive]); - }); + // 注册组件 app.component('MarkdownTitle', MarkdownTitle); app.component('MarkdownImage', MarkdownImage); diff --git a/package.json b/package.json index c883478..3d7c546 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ }, "pnpm": { "overrides": { - "axios": "1.7.4", + "axios": "1.12.2", "ua-parser-js": "1.0.34" } }, @@ -25,25 +25,20 @@ "@opensig/open-analytics": "0.0.9", "@opensig/opendesign": "0.0.68", "@vueuse/core": "9.12.0", - "axios": "1.7.4", + "axios": "1.12.2", "clipboard": "2.0.11", "element-plus": "2.3.12", - "gray-matter": "4.0.3", - "highlight.js": "11.9.0", "js-cookie": "3.0.5", - "lodash-es": "4.17.21", "pinia": "2.1.6", "vue": "3.3.4", - "vue-dompurify-html": "3.1.2", - "vue-i18n": "9.2.2" + "vue-dompurify-html": "5.3.0", + "vue-i18n": "11.1.12" }, "devDependencies": { "@eslint/js": "^9.29.0", "@rushstack/eslint-patch": "^1.3.3", "@tsconfig/node18": "^18.2.2", - "@types/highlight.js": "^10.1.0", "@types/js-cookie": "^3.0.6", - "@types/lodash-es": "^4.17.12", "@types/markdown-it": "^14.1.2", "@types/node": "^18.18.10", "@vitejs/plugin-basic-ssl": "^1.1.0", @@ -57,6 +52,7 @@ "fs-extra": "^11.2.0", "github-markdown-css": "5.1.0", "globals": "^16.2.0", + "gray-matter": "4.0.3", "js-yaml": "^4.1.0", "markdown-it": "^14.1.0", "markdown-it-anchor": "^9.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 69f4a97..d30a196 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,7 +5,7 @@ settings: excludeLinksFromLockfile: false overrides: - axios: 1.7.4 + axios: 1.12.2 ua-parser-js: 1.0.34 importers: @@ -22,26 +22,17 @@ importers: specifier: 9.12.0 version: 9.12.0(vue@3.3.4) axios: - specifier: 1.7.4 - version: 1.7.4 + specifier: 1.12.2 + version: 1.12.2 clipboard: specifier: 2.0.11 version: 2.0.11 element-plus: specifier: 2.3.12 version: 2.3.12(vue@3.3.4) - gray-matter: - specifier: 4.0.3 - version: 4.0.3 - highlight.js: - specifier: 11.9.0 - version: 11.9.0 js-cookie: specifier: 3.0.5 version: 3.0.5 - lodash-es: - specifier: 4.17.21 - version: 4.17.21 pinia: specifier: 2.1.6 version: 2.1.6(typescript@5.2.2)(vue@3.3.4) @@ -49,11 +40,11 @@ importers: specifier: 3.3.4 version: 3.3.4 vue-dompurify-html: - specifier: 3.1.2 - version: 3.1.2(vue@3.3.4) + specifier: 5.3.0 + version: 5.3.0(vue@3.3.4) vue-i18n: - specifier: 9.2.2 - version: 9.2.2(vue@3.3.4) + specifier: 11.1.12 + version: 11.1.12(vue@3.3.4) devDependencies: '@eslint/js': specifier: ^9.29.0 @@ -64,15 +55,9 @@ importers: '@tsconfig/node18': specifier: ^18.2.2 version: 18.2.4 - '@types/highlight.js': - specifier: ^10.1.0 - version: 10.1.0 '@types/js-cookie': specifier: ^3.0.6 version: 3.0.6 - '@types/lodash-es': - specifier: ^4.17.12 - version: 4.17.12 '@types/markdown-it': specifier: ^14.1.2 version: 14.1.2 @@ -112,6 +97,9 @@ importers: globals: specifier: ^16.2.0 version: 16.2.0 + gray-matter: + specifier: 4.0.3 + version: 4.0.3 js-yaml: specifier: ^4.1.0 version: 4.1.0 @@ -141,7 +129,7 @@ importers: version: 0.17.4(@vue/compiler-sfc@3.5.13)(vue-template-compiler@2.7.16) vitepress: specifier: ^1.5.0 - version: 1.5.0(@algolia/client-search@5.19.0)(@types/node@18.19.70)(async-validator@4.2.5)(axios@1.7.4)(markdown-it-mathjax3@4.3.2)(postcss@8.4.49)(sass@1.62.0)(search-insights@2.17.3)(typescript@5.2.2) + version: 1.5.0(@algolia/client-search@5.19.0)(@types/node@18.19.70)(async-validator@4.2.5)(axios@1.12.2)(markdown-it-mathjax3@4.3.2)(postcss@8.4.49)(sass@1.62.0)(search-insights@2.17.3)(typescript@5.2.2) vitest: specifier: ^3.2.3 version: 3.2.3(@types/node@18.19.70)(sass@1.62.0) @@ -609,25 +597,17 @@ packages: '@iconify/utils@2.2.1': resolution: {integrity: sha512-0/7J7hk4PqXmxo5PDBDxmnecw5PxklZJfNjIVG9FM0mEfVrvfudS22rYWsqVk6gR3UJ/mSYS90X4R3znXnqfNA==} - '@intlify/core-base@9.2.2': - resolution: {integrity: sha512-JjUpQtNfn+joMbrXvpR4hTF8iJQ2sEFzzK3KIESOx+f+uwIjgw20igOyaIdhfsVVBCds8ZM64MoeNSx+PHQMkA==} - engines: {node: '>= 14'} - - '@intlify/devtools-if@9.2.2': - resolution: {integrity: sha512-4ttr/FNO29w+kBbU7HZ/U0Lzuh2cRDhP8UlWOtV9ERcjHzuyXVZmjyleESK6eVP60tGC9QtQW9yZE+JeRhDHkg==} - engines: {node: '>= 14'} - - '@intlify/message-compiler@9.2.2': - resolution: {integrity: sha512-IUrQW7byAKN2fMBe8z6sK6riG1pue95e5jfokn8hA5Q3Bqy4MBJ5lJAofUsawQJYHeoPJ7svMDyBaVJ4d0GTtA==} - engines: {node: '>= 14'} + '@intlify/core-base@11.1.12': + resolution: {integrity: sha512-whh0trqRsSqVLNEUCwU59pyJZYpU8AmSWl8M3Jz2Mv5ESPP6kFh4juas2NpZ1iCvy7GlNRffUD1xr84gceimjg==} + engines: {node: '>= 16'} - '@intlify/shared@9.2.2': - resolution: {integrity: sha512-wRwTpsslgZS5HNyM7uDQYZtxnbI12aGiBZURX3BTR9RFIKKRWpllTsgzHWvj3HKm3Y2Sh5LPC1r0PDCKEhVn9Q==} - engines: {node: '>= 14'} + '@intlify/message-compiler@11.1.12': + resolution: {integrity: sha512-Fv9iQSJoJaXl4ZGkOCN1LDM3trzze0AS2zRz2EHLiwenwL6t0Ki9KySYlyr27yVOj5aVz0e55JePO+kELIvfdQ==} + engines: {node: '>= 16'} - '@intlify/vue-devtools@9.2.2': - resolution: {integrity: sha512-+dUyqyCHWHb/UcvY1MlIpO87munedm3Gn6E9WWYdWrMuYLcoIoOEVDWSS8xSwtlPU+kA+MEQTP6Q1iI/ocusJg==} - engines: {node: '>= 14'} + '@intlify/shared@11.1.12': + resolution: {integrity: sha512-Om86EjuQtA69hdNj3GQec9ZC0L0vPSAnXzB3gP/gyJ7+mA7t06d9aOAiqMZ+xEOsumGP4eEBlfl8zF2LOTzf2A==} + engines: {node: '>= 16'} '@jridgewell/gen-mapping@0.3.8': resolution: {integrity: sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==} @@ -821,10 +801,6 @@ packages: '@types/hast@3.0.4': resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==} - '@types/highlight.js@10.1.0': - resolution: {integrity: sha512-77hF2dGBsOgnvZll1vymYiNUtqJ8cJfXPD6GG/2M0aLRc29PkvB7Au6sIDjIEFcSICBhCh2+Pyq6WSRS7LUm6A==} - deprecated: This is a stub types definition. highlight.js provides its own type definitions, so you do not need this installed. - '@types/js-cookie@3.0.6': resolution: {integrity: sha512-wkw9yd1kEXOPnvEeEV1Go1MmxtBJL0RR79aOTAApecWFVu7w0NNXNqhcWgvw2YgZDYadliXkl14pa3WXw5jlCQ==} @@ -855,6 +831,9 @@ packages: '@types/semver@7.5.8': resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} + '@types/trusted-types@2.0.7': + resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==} + '@types/unist@3.0.3': resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} @@ -1176,7 +1155,7 @@ packages: resolution: {integrity: sha512-5fzRl0apQWrDezmobchoiGTkGw238VWESxZHazfhP3RM7pDSiyXy18QbfYkILoYNTd23HPAfQTJpkUc5QbkwTw==} peerDependencies: async-validator: ^4 - axios: 1.7.4 + axios: 1.12.2 change-case: ^5 drauu: ^0.4 focus-trap: ^7 @@ -1279,8 +1258,8 @@ packages: asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - axios@1.7.4: - resolution: {integrity: sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==} + axios@1.12.2: + resolution: {integrity: sha512-vMJzPewAlRyOgxV2dU0Cuz2O8zzzx9VYtbJOaBgXFeLc4IV/Eg50n4LowmehOOR61S8ZMpc2K5Sa7g6A4jfkUw==} balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -1314,6 +1293,10 @@ packages: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} + call-bind-apply-helpers@1.0.2: + resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} + engines: {node: '>= 0.4'} + callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} @@ -1480,12 +1463,16 @@ packages: resolution: {integrity: sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==} engines: {node: '>= 4'} - dompurify@2.5.8: - resolution: {integrity: sha512-o1vSNgrmYMQObbSSvF/1brBYEQPHhV1+gsmrusO7/GXtp1T9rCS8cXFqVxK/9crT1jA6Ccv+5MTSjBNqr7Sovw==} + dompurify@3.2.6: + resolution: {integrity: sha512-/2GogDQlohXPZe6D6NOgQvXLPSYBqIWMnZ8zzOhn09REE4eyAzb+Hed3jhoM9OkuaJ8P6ZGTTVWQKAi8ieIzfQ==} domutils@2.8.0: resolution: {integrity: sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==} + dunder-proto@1.0.1: + resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} + engines: {node: '>= 0.4'} + electron-to-chromium@1.5.79: resolution: {integrity: sha512-nYOxJNxQ9Om4EC88BE4pPoNI8xwSFf8pU/BAeOl4Hh/b/i6V4biTAzwV7pXi3ARKeoYO5JZKMIXTryXSVer5RA==} @@ -1504,9 +1491,25 @@ packages: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} + es-define-property@1.0.1: + resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} + engines: {node: '>= 0.4'} + + es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + es-module-lexer@1.7.0: resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==} + es-object-atoms@1.1.1: + resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} + engines: {node: '>= 0.4'} + + es-set-tostringtag@2.1.0: + resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==} + engines: {node: '>= 0.4'} + esbuild@0.21.5: resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} engines: {node: '>=12'} @@ -1688,8 +1691,8 @@ packages: debug: optional: true - form-data@4.0.1: - resolution: {integrity: sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==} + form-data@4.0.4: + resolution: {integrity: sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==} engines: {node: '>= 6'} fs-extra@11.2.0: @@ -1701,10 +1704,21 @@ packages: engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] + function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + gensync@1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} + get-intrinsic@1.3.0: + resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} + engines: {node: '>= 0.4'} + + get-proto@1.0.1: + resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} + engines: {node: '>= 0.4'} + get-stream@6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} @@ -1747,6 +1761,10 @@ packages: good-listener@1.2.2: resolution: {integrity: sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==} + gopd@1.2.0: + resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} + engines: {node: '>= 0.4'} + graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} @@ -1761,6 +1779,18 @@ packages: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} + has-symbols@1.1.0: + resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} + engines: {node: '>= 0.4'} + + has-tostringtag@1.0.2: + resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} + engines: {node: '>= 0.4'} + + hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + engines: {node: '>= 0.4'} + hast-util-to-html@9.0.4: resolution: {integrity: sha512-wxQzXtdbhiwGAUKrnQJXlOPmHnEehzphwkK7aluUPQ+lEc1xefC8pblMgpp2w5ldBTEfveRIrADcrhGIWrlTDA==} @@ -1771,10 +1801,6 @@ packages: resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} hasBin: true - highlight.js@11.9.0: - resolution: {integrity: sha512-fJ7cW7fQGCYAkgv4CPfwFHrfd/cLS4Hau96JuJ+ZTOWhjnhoeN1ub1tFmALm/+lW5z4WCAuAV9bm05AP0mS6Gw==} - engines: {node: '>=12.0.0'} - hookable@5.5.3: resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} @@ -1956,6 +1982,10 @@ packages: resolution: {integrity: sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==} hasBin: true + math-intrinsics@1.1.0: + resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} + engines: {node: '>= 0.4'} + mathjax-full@3.2.2: resolution: {integrity: sha512-+LfG9Fik+OuI8SLwsiR02IVdjcnRCy5MufYLi0C3TdMT56L/pjB0alMVGgoWJF8pN9Rc7FESycZB9BMNWIid5w==} @@ -2294,10 +2324,6 @@ packages: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} - source-map@0.6.1: - resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} - engines: {node: '>=0.10.0'} - space-separated-tokens@2.0.2: resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==} @@ -2581,17 +2607,6 @@ packages: jsdom: optional: true - vue-demi@0.13.11: - resolution: {integrity: sha512-IR8HoEEGM65YY3ZJYAjMlKygDQn25D5ajNFNoKh9RSDMQtlzCxtfQjdQgv9jjK+m3377SsJXY8ysq8kLCZL25A==} - engines: {node: '>=12'} - hasBin: true - peerDependencies: - '@vue/composition-api': ^1.0.0-rc.1 - vue: ^3.0.0-0 || ^2.6.0 - peerDependenciesMeta: - '@vue/composition-api': - optional: true - vue-demi@0.14.10: resolution: {integrity: sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==} engines: {node: '>=12'} @@ -2603,10 +2618,10 @@ packages: '@vue/composition-api': optional: true - vue-dompurify-html@3.1.2: - resolution: {integrity: sha512-2xCnSuog5+OPUtmeAwPZY/6oV9YKuLhjgcl5EUw3jKbmhnyPo8YyCczCeRNGBorVcz1fCGm6PEOIUSXNS8I0ZA==} + vue-dompurify-html@5.3.0: + resolution: {integrity: sha512-HJQGBHbfSPcb6Mu97McdKbX7TqRHZa6Ji8OCpCNyuHca5QvQZ8IiuwghFPSO8OkSQfqXPNPKFMZdCOrnGGmOSQ==} peerDependencies: - vue: ^2.7.0 || ^3.0.0 + vue: ^3.4.36 vue-eslint-parser@9.4.3: resolution: {integrity: sha512-2rYRLWlIpaiN8xbPiDyXZXRgLGOtWxERV7ND5fFAv5qo1D2N9Fu9MNajBNc6o13lZ+24DAWCkQCvj4klgmcITg==} @@ -2614,9 +2629,9 @@ packages: peerDependencies: eslint: '>=6.0.0' - vue-i18n@9.2.2: - resolution: {integrity: sha512-yswpwtj89rTBhegUAv9Mu37LNznyu3NpyLQmozF3i1hYOhwpG8RjcjIFIIfnu+2MDZJGSZPXaKWvnQA71Yv9TQ==} - engines: {node: '>= 14'} + vue-i18n@11.1.12: + resolution: {integrity: sha512-BnstPj3KLHLrsqbVU2UOrPmr0+Mv11bsUZG0PyCOzsawCivk8W00GMXHeVUWIDOgNaScCuZah47CZFE+Wnl8mw==} + engines: {node: '>= 16'} peerDependencies: vue: ^3.0.0 @@ -3179,28 +3194,17 @@ snapshots: transitivePeerDependencies: - supports-color - '@intlify/core-base@9.2.2': - dependencies: - '@intlify/devtools-if': 9.2.2 - '@intlify/message-compiler': 9.2.2 - '@intlify/shared': 9.2.2 - '@intlify/vue-devtools': 9.2.2 - - '@intlify/devtools-if@9.2.2': + '@intlify/core-base@11.1.12': dependencies: - '@intlify/shared': 9.2.2 + '@intlify/message-compiler': 11.1.12 + '@intlify/shared': 11.1.12 - '@intlify/message-compiler@9.2.2': + '@intlify/message-compiler@11.1.12': dependencies: - '@intlify/shared': 9.2.2 - source-map: 0.6.1 - - '@intlify/shared@9.2.2': {} + '@intlify/shared': 11.1.12 + source-map-js: 1.2.1 - '@intlify/vue-devtools@9.2.2': - dependencies: - '@intlify/core-base': 9.2.2 - '@intlify/shared': 9.2.2 + '@intlify/shared@11.1.12': {} '@jridgewell/gen-mapping@0.3.8': dependencies: @@ -3358,10 +3362,6 @@ snapshots: dependencies: '@types/unist': 3.0.3 - '@types/highlight.js@10.1.0': - dependencies: - highlight.js: 11.9.0 - '@types/js-cookie@3.0.6': {} '@types/json-schema@7.0.15': {} @@ -3391,6 +3391,9 @@ snapshots: '@types/semver@7.5.8': {} + '@types/trusted-types@2.0.7': + optional: true + '@types/unist@3.0.3': {} '@types/web-bluetooth@0.0.16': {} @@ -3878,14 +3881,14 @@ snapshots: - '@vue/composition-api' - vue - '@vueuse/integrations@11.3.0(async-validator@4.2.5)(axios@1.7.4)(focus-trap@7.6.2)(vue@3.5.13(typescript@5.2.2))': + '@vueuse/integrations@11.3.0(async-validator@4.2.5)(axios@1.12.2)(focus-trap@7.6.2)(vue@3.5.13(typescript@5.2.2))': dependencies: '@vueuse/core': 11.3.0(vue@3.5.13(typescript@5.2.2)) '@vueuse/shared': 11.3.0(vue@3.5.13(typescript@5.2.2)) vue-demi: 0.14.10(vue@3.5.13(typescript@5.2.2)) optionalDependencies: async-validator: 4.2.5 - axios: 1.7.4 + axios: 1.12.2 focus-trap: 7.6.2 transitivePeerDependencies: - '@vue/composition-api' @@ -3969,10 +3972,10 @@ snapshots: asynckit@0.4.0: {} - axios@1.7.4: + axios@1.12.2: dependencies: follow-redirects: 1.15.9 - form-data: 4.0.1 + form-data: 4.0.4 proxy-from-env: 1.1.0 transitivePeerDependencies: - debug @@ -4007,6 +4010,11 @@ snapshots: cac@6.7.14: {} + call-bind-apply-helpers@1.0.2: + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + callsites@3.1.0: {} caniuse-lite@1.0.30001692: {} @@ -4166,7 +4174,9 @@ snapshots: dependencies: domelementtype: 2.3.0 - dompurify@2.5.8: {} + dompurify@3.2.6: + optionalDependencies: + '@types/trusted-types': 2.0.7 domutils@2.8.0: dependencies: @@ -4174,6 +4184,12 @@ snapshots: domelementtype: 2.3.0 domhandler: 4.3.1 + dunder-proto@1.0.1: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-errors: 1.3.0 + gopd: 1.2.0 + electron-to-chromium@1.5.79: {} element-plus@2.3.12(vue@3.3.4): @@ -4203,8 +4219,23 @@ snapshots: entities@4.5.0: {} + es-define-property@1.0.1: {} + + es-errors@1.3.0: {} + es-module-lexer@1.7.0: {} + es-object-atoms@1.1.1: + dependencies: + es-errors: 1.3.0 + + es-set-tostringtag@2.1.0: + dependencies: + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + has-tostringtag: 1.0.2 + hasown: 2.0.2 + esbuild@0.21.5: optionalDependencies: '@esbuild/aix-ppc64': 0.21.5 @@ -4422,10 +4453,12 @@ snapshots: follow-redirects@1.15.9: {} - form-data@4.0.1: + form-data@4.0.4: dependencies: asynckit: 0.4.0 combined-stream: 1.0.8 + es-set-tostringtag: 2.1.0 + hasown: 2.0.2 mime-types: 2.1.35 fs-extra@11.2.0: @@ -4437,8 +4470,28 @@ snapshots: fsevents@2.3.3: optional: true + function-bind@1.1.2: {} + gensync@1.0.0-beta.2: {} + get-intrinsic@1.3.0: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-define-property: 1.0.1 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + function-bind: 1.1.2 + get-proto: 1.0.1 + gopd: 1.2.0 + has-symbols: 1.1.0 + hasown: 2.0.2 + math-intrinsics: 1.1.0 + + get-proto@1.0.1: + dependencies: + dunder-proto: 1.0.1 + es-object-atoms: 1.1.1 + get-stream@6.0.1: {} github-markdown-css@5.1.0: {} @@ -4476,6 +4529,8 @@ snapshots: dependencies: delegate: 3.2.0 + gopd@1.2.0: {} + graceful-fs@4.2.11: {} graphemer@1.4.0: {} @@ -4489,6 +4544,16 @@ snapshots: has-flag@4.0.0: {} + has-symbols@1.1.0: {} + + has-tostringtag@1.0.2: + dependencies: + has-symbols: 1.1.0 + + hasown@2.0.2: + dependencies: + function-bind: 1.1.2 + hast-util-to-html@9.0.4: dependencies: '@types/hast': 3.0.4 @@ -4509,8 +4574,6 @@ snapshots: he@1.2.0: {} - highlight.js@11.9.0: {} - hookable@5.5.3: {} html-tags@3.3.1: {} @@ -4678,6 +4741,8 @@ snapshots: punycode.js: 2.3.1 uc.micro: 2.1.0 + math-intrinsics@1.1.0: {} + mathjax-full@3.2.2: dependencies: esm: 3.2.25 @@ -4996,8 +5061,6 @@ snapshots: source-map-js@1.2.1: {} - source-map@0.6.1: {} - space-separated-tokens@2.0.2: {} speakingurl@14.0.1: {} @@ -5206,7 +5269,7 @@ snapshots: fsevents: 2.3.3 sass: 1.62.0 - vitepress@1.5.0(@algolia/client-search@5.19.0)(@types/node@18.19.70)(async-validator@4.2.5)(axios@1.7.4)(markdown-it-mathjax3@4.3.2)(postcss@8.4.49)(sass@1.62.0)(search-insights@2.17.3)(typescript@5.2.2): + vitepress@1.5.0(@algolia/client-search@5.19.0)(@types/node@18.19.70)(async-validator@4.2.5)(axios@1.12.2)(markdown-it-mathjax3@4.3.2)(postcss@8.4.49)(sass@1.62.0)(search-insights@2.17.3)(typescript@5.2.2): dependencies: '@docsearch/css': 3.8.2 '@docsearch/js': 3.8.2(@algolia/client-search@5.19.0)(search-insights@2.17.3) @@ -5219,7 +5282,7 @@ snapshots: '@vue/devtools-api': 7.7.0 '@vue/shared': 3.5.13 '@vueuse/core': 11.3.0(vue@3.5.13(typescript@5.2.2)) - '@vueuse/integrations': 11.3.0(async-validator@4.2.5)(axios@1.7.4)(focus-trap@7.6.2)(vue@3.5.13(typescript@5.2.2)) + '@vueuse/integrations': 11.3.0(async-validator@4.2.5)(axios@1.12.2)(focus-trap@7.6.2)(vue@3.5.13(typescript@5.2.2)) focus-trap: 7.6.2 mark.js: 8.11.1 minisearch: 7.1.1 @@ -5295,10 +5358,6 @@ snapshots: - supports-color - terser - vue-demi@0.13.11(vue@3.3.4): - dependencies: - vue: 3.3.4 - vue-demi@0.14.10(vue@3.3.4): dependencies: vue: 3.3.4 @@ -5307,13 +5366,10 @@ snapshots: dependencies: vue: 3.5.13(typescript@5.2.2) - vue-dompurify-html@3.1.2(vue@3.3.4): + vue-dompurify-html@5.3.0(vue@3.3.4): dependencies: - dompurify: 2.5.8 + dompurify: 3.2.6 vue: 3.3.4 - vue-demi: 0.13.11(vue@3.3.4) - transitivePeerDependencies: - - '@vue/composition-api' vue-eslint-parser@9.4.3(eslint@9.29.0): dependencies: @@ -5328,11 +5384,10 @@ snapshots: transitivePeerDependencies: - supports-color - vue-i18n@9.2.2(vue@3.3.4): + vue-i18n@11.1.12(vue@3.3.4): dependencies: - '@intlify/core-base': 9.2.2 - '@intlify/shared': 9.2.2 - '@intlify/vue-devtools': 9.2.2 + '@intlify/core-base': 11.1.12 + '@intlify/shared': 11.1.12 '@vue/devtools-api': 6.6.4 vue: 3.3.4 -- Gitee From 0857dc4ce47d79a2c9b647d7ef8a293341c37553 Mon Sep 17 00:00:00 2001 From: luckyasme <807254037@qq.com> Date: Sun, 28 Sep 2025 11:31:00 +0800 Subject: [PATCH 5/5] feat: 2203_lts_sp4 --- app/.vitepress/src/App.vue | 2 +- app/.vitepress/src/config/version.ts | 2 -- app/.vitepress/src/utils/common.ts | 3 ++- app/.vitepress/src/views/docs/TheDocsArticle.vue | 13 +++++++++++++ deploy/nginx/nginx.portal.conf | 13 ++++++++++--- scripts/config/new-version.js | 3 ++- scripts/merge-redirect.js | 4 ++-- scripts/merge.js | 14 +++++++++++--- 8 files changed, 41 insertions(+), 13 deletions(-) diff --git a/app/.vitepress/src/App.vue b/app/.vitepress/src/App.vue index d853ba6..4f4a71b 100644 --- a/app/.vitepress/src/App.vue +++ b/app/.vitepress/src/App.vue @@ -18,7 +18,7 @@ const { isZh } = useLocale(); const viewStore = useViewStore(); const router = useRouter(); -router.onBeforeRouteChange = () => { +router.onAfterRouteChanged = () => { scrollToTop(0, false); }; diff --git a/app/.vitepress/src/config/version.ts b/app/.vitepress/src/config/version.ts index 1c89b44..abb38c0 100644 --- a/app/.vitepress/src/config/version.ts +++ b/app/.vitepress/src/config/version.ts @@ -19,7 +19,6 @@ export const versions = { { label: '22.03 LTS SP4', value: '22.03_LTS_SP4', - href: '/zh/docs/22.03_LTS_SP4/docs/Releasenotes/%E6%B3%95%E5%BE%8B%E5%A3%B0%E6%98%8E.html', }, { label: '24.03 LTS', @@ -139,7 +138,6 @@ export const versions = { { label: '22.03 LTS SP4', value: '22.03_LTS_SP4', - href: '/en/docs/22.03_LTS_SP4/docs/Releasenotes/terms-of-use.html', }, { label: '24.03 LTS', diff --git a/app/.vitepress/src/utils/common.ts b/app/.vitepress/src/utils/common.ts index 7ba8b5d..811240e 100644 --- a/app/.vitepress/src/utils/common.ts +++ b/app/.vitepress/src/utils/common.ts @@ -125,10 +125,11 @@ export function getGiteeUrl(node: DocMenuNodeT | null) { const [_, lang, __, branch, ...others] = pathname.split('/'); const map: Record = { common: 'stable-common', - '25.09': 'master', + '25.09': 'stable-25.09', '25.03': 'stable-25.03', '24.03_LTS_SP1': 'stable-24.03_LTS_SP1', '24.03_LTS_SP2': 'stable-24.03_LTS_SP2', + '22.03_LTS_SP4': 'stable-22.03_LTS_SP4', }; return `https://gitee.com/openeuler/docs/blob/${map[branch]}/docs/${lang}/${others.join('/')}`; diff --git a/app/.vitepress/src/views/docs/TheDocsArticle.vue b/app/.vitepress/src/views/docs/TheDocsArticle.vue index dedafcb..436ce81 100644 --- a/app/.vitepress/src/views/docs/TheDocsArticle.vue +++ b/app/.vitepress/src/views/docs/TheDocsArticle.vue @@ -8,6 +8,7 @@ import { type DocMenuNodeT } from '@/utils/tree'; import { getOffsetTop, getScrollRemainingBottom } from '@/utils/element'; import { useViewStore } from '@/stores/view'; import { useNodeStore } from '@/stores/node'; +import { useRouter } from 'vitepress'; const emits = defineEmits<{ (evt: 'update-menu-expaned'): void; @@ -18,6 +19,7 @@ const emits = defineEmits<{ const viewStore = useViewStore(); const nodeStore = useNodeStore(); +const router = useRouter(); // -------------------- 菜单更新锚点选中 -------------------- const onScrollUpdateAnchor = () => { @@ -130,6 +132,17 @@ const onClickContent = (evt: PointerEvent) => { }, 200); } }; + +// -------------------- 处理跨语言、跨指南跳转 -------------------- +router.onBeforeRouteChange = (to) => { + const [_1, _2, _3, maybeLange, ...paths] = to.split('/'); + if (maybeLange === 'zh' || maybeLange === 'en') { + const [_4, _5, _6, version] = window.location.pathname.split('/'); + router.go(`/${maybeLange}/docs/${version}/${paths.join('/')}`); + return false; + } + return true; +};