From a93e52a37cc9a821e8eac066b33d71320161f1e8 Mon Sep 17 00:00:00 2001
From: luckyasme <807254037@qq.com>
Date: Mon, 24 Mar 2025 16:12:07 +0800
Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E5=AE=8C=E5=96=84header=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/.vitepress/src/i18n/header/header-en.ts | 162 ++++++++++----------
app/.vitepress/src/i18n/header/header-zh.ts | 14 +-
2 files changed, 86 insertions(+), 90 deletions(-)
diff --git a/app/.vitepress/src/i18n/header/header-en.ts b/app/.vitepress/src/i18n/header/header-en.ts
index cb0d4f0..2fc0377 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 43dbab6..e854348 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',
},
],
},
--
Gitee
From 46c80fffb982bfee1d0967814d8e2fc23bf283f7 Mon Sep 17 00:00:00 2001
From: luckyasme <807254037@qq.com>
Date: Mon, 24 Mar 2025 19:42:22 +0800
Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E5=9B=BE=E7=89=87?=
=?UTF-8?q?=E6=94=BE=E5=A4=A7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/.vitepress/config.ts | 23 +++++++++++++++++++++++
app/.vitepress/src/utils/common.ts | 1 -
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/app/.vitepress/config.ts b/app/.vitepress/config.ts
index 646fbc0..ddc0273 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/utils/common.ts b/app/.vitepress/src/utils/common.ts
index e35f083..46b4799 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
--
Gitee