diff --git a/app/.vitepress/config.ts b/app/.vitepress/config.ts index 646fbc08a22ba537a2edca85786bb396f2b3d7b6..ddc0273e3e638dd10f20edb7ae20018bdac1d1b8 100644 --- a/app/.vitepress/config.ts +++ b/app/.vitepress/config.ts @@ -105,6 +105,29 @@ export default { md.renderer.rules.image = (...args) => { return `${imageRender!!(...args)}`; }; + + // 处理文档里写的html标签 + const defaultHtmlBlockRender = md.renderer.rules.html_block; + md.renderer.rules.html_block = (tokens, idx, options, env, self) => { + const content = tokens[idx].content; + const renderContent = defaultHtmlBlockRender!!(tokens, idx, options, env, self); + if (content.includes('${renderContent.replace(/(width|height)=['|"](.*?)['|"]/g, '')}`; + } + + return renderContent; + }; + + const defaultHtmlInlineRender = md.renderer.rules.html_inline; + md.renderer.rules.html_inline = function (tokens, idx, options, env, self) { + const content = tokens[idx].content; + const renderContent = defaultHtmlInlineRender!!(tokens, idx, options, env, self); + if (content.includes('${renderContent.replace(/(width|height)=['|"](.*?)['|"]/g, '')}`; + } + + return renderContent; + }; }, }, }; diff --git a/app/.vitepress/src/i18n/header/header-en.ts b/app/.vitepress/src/i18n/header/header-en.ts index cb0d4f095b8b742f5bd4bdba6210282b40970fb2..2fc0377596c8fab68ab192db00a51ddbd4c9bd3e 100644 --- a/app/.vitepress/src/i18n/header/header-en.ts +++ b/app/.vitepress/src/i18n/header/header-en.ts @@ -198,48 +198,102 @@ export default { ], }, { - NAME: 'Learn', - ID: 'learn', + NAME: 'Develop', + ID: 'development', CHILDREN: [ { - NAME: 'Documentation', - ICON: ArrowRight, - URL: 'https://docs.openeuler.org/en/', + NAME: 'Build', CHILDREN: [ { - NAME: 'Trending Docs', - DESCRIPTION: 'The most viewed documents.', - TAG: TAG_TYPE.HOT, - URL: 'https://docs.openeuler.org/en/#hot', + NAME: 'EulerMaker', + DESCRIPTION: 'An open, unified build service for streamlined development.', + URL: 'https://eulermaker.compass-ci.openeuler.openatom.cn/', + ANALYTICSNAME: 'eulermaker', }, { - NAME: 'Create Apps', - DESCRIPTION: 'Guides for application development on openEuler.', - URL: 'https://docs.openeuler.org/en/docs/24.03_LTS/docs/ApplicationDev/application-development.html', + NAME: 'openEuler User Repo', + DESCRIPTION: 'An easy-to-use package hosting and distribution platform.', + URL: 'https://eur.openeuler.openatom.cn/coprs/', }, { - NAME: 'Getting Started', - DESCRIPTION: 'Documentation guides to help you get started with openEuler.', - URL: 'https://docs.openeuler.org/en/#process', + NAME: 'Submit Package', + DESCRIPTION: 'Contribute software packages efficiently to the community.', + URL: 'https://software-pkg.openeuler.org/en/package', }, + ], + }, + { + NAME: 'Release', + CHILDREN: [ { - NAME: 'Tools', - DESCRIPTION: 'Resources for using and accessing commonly used tools.', - TAG: TAG_TYPE.HOT, - URL: 'https://docs.openeuler.org/en/#tool', + NAME: 'OEPKGS', + DESCRIPTION: 'A third-party extension repository for openEuler.', + URL: 'https://oepkgs.net/en-CN', + ICON: OutLink, }, ], - SHORTCUT: [ + }, + { + NAME: 'Analyze', + CHILDREN: [ { - NAME: 'openEuler 24.03 LTS Documentation', - URL: 'https://docs.openeuler.org/en/docs/24.03_LTS/docs/Releasenotes/terms-of-use.html', + NAME: 'Pkgship', + DESCRIPTION: 'A tool to query OS package information and dependencies with ease.', + URL: 'https://pkgmanage.openeuler.org/', + ANALYTICSNAME: 'pkgship', + }, + ], + }, + { + NAME: 'Submit Issue', + CHILDREN: [ + { + NAME: 'QuickIssue', + DESCRIPTION: 'Submit and track community issues quickly and easily.', + URL: 'https://quickissue.openeuler.org/en/issues/', + }, + ], + }, + ], + }, + { + NAME: 'Document', + ID: 'document', + CHILDREN: [ + { + NAME: 'Document Center', + ICON: ArrowRight, + URL: 'https://openeuler-docs.test.osinfra.cn/en/', + CHILDREN: [ + { + NAME: 'Quick Start', + DESCRIPTION: 'Learn the community essentials in 10 minutes, build and grow quickly.', + TAG: TAG_TYPE.HOT, + URL: 'https://openeuler-docs.test.osinfra.cn/en/docs/25.03/server/quickstart/quickstart/quick-start.html', + }, + { + NAME: 'Installation Guide', + DESCRIPTION: 'Step-by-step instructions for installing openEuler.', + URL: 'https://openeuler-docs.test.osinfra.cn/en/docs/25.03/server/installation_upgrade/installation/installation-preparations.html', }, { - NAME: 'Installation and Upgrade', - URL: 'https://docs.openeuler.org/en/docs/24.03_LTS/docs/Installation/Installation.html', + NAME: 'FAQ', + DESCRIPTION: 'Solutions to common issues and troubleshooting tips.', + URL: 'https://openeuler-docs.test.osinfra.cn/en/docs/common/faq/general/general_faq.html', + }, + { + NAME: 'Documentation Guide', + DESCRIPTION: 'Explore ways to participate in document development.', + URL: 'https://openeuler-docs.test.osinfra.cn/en/docs/common/contribute/directory_structure_introductory.html', }, ], }, + ], + }, + { + NAME: 'Learn', + ID: 'learn', + CHILDREN: [ { NAME: 'Training', ICON: ArrowRight, @@ -292,65 +346,7 @@ export default { }, ], }, - { - NAME: 'Develop', - ID: 'development', - CHILDREN: [ - { - NAME: 'Build', - CHILDREN: [ - { - NAME: 'EulerMaker', - DESCRIPTION: 'An open, unified build service for streamlined development.', - URL: 'https://eulermaker.compass-ci.openeuler.openatom.cn/', - ANALYTICSNAME: 'eulermaker', - }, - { - NAME: 'openEuler User Repo', - DESCRIPTION: 'An easy-to-use package hosting and distribution platform.', - URL: 'https://eur.openeuler.openatom.cn/coprs/', - }, - { - NAME: 'Submit Package', - DESCRIPTION: 'Contribute software packages efficiently to the community.', - URL: 'https://software-pkg.openeuler.org/en/package', - }, - ], - }, - { - NAME: 'Release', - CHILDREN: [ - { - NAME: 'OEPKGS', - DESCRIPTION: 'A third-party extension repository for openEuler.', - URL: 'https://oepkgs.net/en-CN', - ICON: OutLink, - }, - ], - }, - { - NAME: 'Analyze', - CHILDREN: [ - { - NAME: 'Pkgship', - DESCRIPTION: 'A tool to query OS package information and dependencies with ease.', - URL: 'https://pkgmanage.openeuler.org/', - ANALYTICSNAME: 'pkgship', - }, - ], - }, - { - NAME: 'Submit Issue', - CHILDREN: [ - { - NAME: 'QuickIssue', - DESCRIPTION: 'Submit and track community issues quickly and easily.', - URL: 'https://quickissue.openeuler.org/en/issues/', - }, - ], - }, - ], - }, + { NAME: 'Support', ID: 'approve', diff --git a/app/.vitepress/src/i18n/header/header-zh.ts b/app/.vitepress/src/i18n/header/header-zh.ts index 43dbab6b55a75a5a5171a5db3a1e8c77d1698743..e854348d7e8390e6f4b03e36b4fecc65639a12ba 100644 --- a/app/.vitepress/src/i18n/header/header-zh.ts +++ b/app/.vitepress/src/i18n/header/header-zh.ts @@ -298,28 +298,28 @@ export default { { NAME: '文档中心', ICON: ArrowRight, - URL: 'https://openeuler-docs.test.osinfra.cn/zh', + URL: 'https://openeuler-docs.test.osinfra.cn/zh/', CHILDREN: [ { NAME: '新手入门', DESCRIPTION: '10分钟玩转社区,快速构建与成长', TAG: TAG_TYPE.HOT, - URL: 'https://openeuler-docs.test.osinfra.cn/zh/Server/Quickstart/Quickstart/quick-start.html', + URL: 'https://openeuler-docs.test.osinfra.cn/zh/docs/25.03/server/quickstart/quickstart/quick-start.html', }, { NAME: '安装指南', - DESCRIPTION: '指导用户顺利完成 openEuler 操作系统安装', - URL: 'https://openeuler-docs.test.osinfra.cn/zh/Server/InstallationUpgrade/Installation/installation-preparations.html', + DESCRIPTION: '安装 openEuler 操作系统', + URL: 'https://openeuler-docs.test.osinfra.cn/zh/docs/25.03/server/installation_upgrade/installation/installation-preparations.html', }, { NAME: '常见问题', DESCRIPTION: '常见问题解决方法', - URL: 'https://www.openeuler.org/zh/faq/', + URL: 'https://openeuler-docs.test.osinfra.cn/zh/docs/common/faq/general/general_faq.html', }, { NAME: '文档开发指南', - DESCRIPTION: '参与文档贡献的方式', - URL: 'https://openeuler-docs.test.osinfra.cn/zh/contribute/directory_structure_introductory.html', + DESCRIPTION: '参与文档开发的方式', + URL: 'https://openeuler-docs.test.osinfra.cn/zh/docs/common/contribute/directory_structure_introductory.html', }, ], }, diff --git a/app/.vitepress/src/utils/common.ts b/app/.vitepress/src/utils/common.ts index e35f083bc58819a03a3c342edbabbadf36e01331..46b47991a4da9450de1cc6ede2aca8881a8fed1e 100644 --- a/app/.vitepress/src/utils/common.ts +++ b/app/.vitepress/src/utils/common.ts @@ -114,6 +114,5 @@ export const getGiteeUrl = () => { // 分支文档内容 const [_, lang, __, branch, ...others] = pathname.split('/'); - console.log(lang, branch, others); return `https://gitee.com/openeuler/docs/tree/${branch}/docs/${lang}/${others.join('/')}`; }; \ No newline at end of file