From aa7621b0ac0fcf0348ffa548f205edfe59f9ccd3 Mon Sep 17 00:00:00 2001 From: luckyasme <807254037@qq.com> Date: Wed, 30 Jul 2025 15:19:23 +0800 Subject: [PATCH] =?UTF-8?q?sycn:=20=E5=90=8C=E6=AD=A5website=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- layouts/partials/nav.html | 4 ++-- static/css/common.css | 26 +++++++++++++++++++++++++ static/css/revision_new.css | 2 +- static/img/common/icon-locale-dark.svg | 3 +++ static/img/common/icon-locale-light.svg | 3 +++ static/js/common.js | 2 ++ static/js/float.js | 2 +- static/js/version_data.js | 15 +++++++++----- 9 files changed, 50 insertions(+), 10 deletions(-) create mode 100644 static/img/common/icon-locale-dark.svg create mode 100644 static/img/common/icon-locale-light.svg diff --git a/.gitignore b/.gitignore index 05b5e1d..bc3a56a 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ public layouts/partials/docs/test-list.html layouts/partials/docs/test-list2.html node_modules -app/** \ No newline at end of file +app/** +.cache \ No newline at end of file diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html index 34d01d9..62d5b2c 100644 --- a/layouts/partials/nav.html +++ b/layouts/partials/nav.html @@ -30,8 +30,8 @@
- {{ i18n "current_lang" }} - + +
{{ .Site.Params.languageZh }} {{ .Site.Params.languageEn }} diff --git a/static/css/common.css b/static/css/common.css index 55d5bc9..e880ad7 100644 --- a/static/css/common.css +++ b/static/css/common.css @@ -281,6 +281,32 @@ i { background-image: url("../img/common/icon-down-dark.svg"); } +.icon-locale { + display: block; + width: 26px; + height: 26px; + background-image: url("../img/common/icon-locale-light.svg"); +} +.light .icon-locale { + background-image: url("../img/common/icon-locale-light.svg"); +} +.dark .icon-locale { + background-image: url("../img/common/icon-locale-dark.svg"); +} + +.locale-tag { + position: absolute; + font-size: 10px; + height: 12px; + width: 12px; + display: flex; + justify-content: center; + align-items: center; + left: 12px; + top: 28px; + background: var(--e-color-bg1); +} + .web-lang { margin-left: 20px; } diff --git a/static/css/revision_new.css b/static/css/revision_new.css index 4a7e523..bb67c01 100644 --- a/static/css/revision_new.css +++ b/static/css/revision_new.css @@ -219,7 +219,7 @@ width: 84px; position: absolute; top: 46px; - left: -40px; + left: -50px; background: var(--e-color-bg2); padding: 0 var(--o-spacing-h5); cursor: pointer; diff --git a/static/img/common/icon-locale-dark.svg b/static/img/common/icon-locale-dark.svg new file mode 100644 index 0000000..edebc67 --- /dev/null +++ b/static/img/common/icon-locale-dark.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/static/img/common/icon-locale-light.svg b/static/img/common/icon-locale-light.svg new file mode 100644 index 0000000..77ff309 --- /dev/null +++ b/static/img/common/icon-locale-light.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/static/js/common.js b/static/js/common.js index 81213ef..fb583ff 100644 --- a/static/js/common.js +++ b/static/js/common.js @@ -238,5 +238,7 @@ $(function ($) { $(".nav-box .docs-a .home-bread,.h5-docs-a .home-bread").click(() => { window.open(`/${lang}/`, "_self"); }); + // 设置语言图标 + $(".locale-tag").text(window.location.href.indexOf('/zh/') > -1 ? "中" : "EN"); }); }); diff --git a/static/js/float.js b/static/js/float.js index 1700cc1..d8cbd3b 100644 --- a/static/js/float.js +++ b/static/js/float.js @@ -459,7 +459,7 @@ $(document).ready(() => { ); } else { openUrl( - `https://gitee.com/-/ide/project/openeuler/docs/edit/stable2-${version}/-/docs/${lang}/docs/${path}?search=${first}&title=文档捉虫-openEuler ${version}-${title}&description=${feedback}&message=${feedback}&label_names=文档捉虫` + `https://gitee.com/-/ide/project/openeuler/docs-centralized/edit/stable2-${version}/-/docs/${lang}/docs/${path}?search=${first}&title=文档捉虫-openEuler ${version}-${title}&description=${feedback}&message=${feedback}&label_names=文档捉虫` ); } } else { diff --git a/static/js/version_data.js b/static/js/version_data.js index 5022650..cf9a943 100644 --- a/static/js/version_data.js +++ b/static/js/version_data.js @@ -4,12 +4,14 @@ * 按照发布时间排序 */ const versionObjZh = { + '24.03 LTS SP2': { + homePath: 'https://docs.openeuler.org/zh/docs/24.03_LTS_SP2/server/releasenotes/releasenotes/introduction.html', + }, '25.03': { - homePath: 'https://docs.openeuler.org/zh/', + homePath: 'https://docs.openeuler.org/zh/docs/25.03/server/releasenotes/releasenotes/introduction.html', }, '24.03 LTS SP1': { - homePath: - '/24.03_LTS_SP1/docs/Releasenotes/%E6%B3%95%E5%BE%8B%E5%A3%B0%E6%98%8E.html', + homePath: 'https://docs.openeuler.org/zh/docs/24.03_LTS_SP1/server/releasenotes/releasenotes/introduction.html', }, 24.09: { homePath: @@ -99,11 +101,14 @@ const versionObjZh = { }; const versionObjEn = { + '24.03 LTS SP2': { + homePath: 'https://docs.openeuler.org/en/docs/24.03_LTS_SP2/server/releasenotes/releasenotes/introduction.html', + }, '25.03': { - homePath: 'https://docs.openeuler.org/en/', + homePath: 'https://docs.openeuler.org/en/docs/25.03/server/releasenotes/releasenotes/introduction.html', }, '24.03 LTS SP1': { - homePath: '/24.03_LTS_SP1/docs/Releasenotes/terms-of-use.html', + homePath: 'https://docs.openeuler.org/en/docs/24.03_LTS_SP1/server/releasenotes/releasenotes/introduction.html', }, 24.09: { homePath: '/24.09/docs/Releasenotes/terms-of-use.html', -- Gitee