From 3a4fb6a636c78d48eb15aac3e7ff86c92dffe7d6 Mon Sep 17 00:00:00 2001 From: faweizhao26 Date: Sat, 28 Feb 2026 17:38:14 +0800 Subject: [PATCH 1/2] fix two links and add the link of gitcode Signed-off-by: faweizhao26 --- docusaurus.config.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docusaurus.config.js b/docusaurus.config.js index 89bfbad..38862a5 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -1,5 +1,8 @@ const lightCodeTheme = require('prism-react-renderer/themes/github'); const darkCodeTheme = require('prism-react-renderer/themes/dracula'); +const currentLocale = process.env.DOCUSAURUS_CURRENT_LOCALE || 'en'; +const docsLocaleSegment = currentLocale === 'zh-CN' ? 'cn' : 'en'; +const docsBaseUrl = `https://docs.ivorysql.org/${docsLocaleSegment}/ivorysql-doc/v5.1/v5.1`; /** @type {import('@docusaurus/types').Config} */ const config = { @@ -120,7 +123,7 @@ const config = { }, { label: 'Installation', - href: 'https://docs.ivorysql.org/en/ivorysql-doc/v5.1/v5.1/3.1#quick-installation', + href: `${docsBaseUrl}/3.1#quick-installation`, }, { label: 'Contribution Guidelines', @@ -146,7 +149,7 @@ const config = { }, { label: 'Ecological Cooperation', - href: 'https://docs.ivorysql.org/en/ivorysql-doc/v5.1/v5.1/5.0', + href: `${docsBaseUrl}/5.0`, position: 'left' }, { @@ -181,6 +184,10 @@ const config = { href: 'https://github.com/IvorySQL/IvorySQL', label: 'Github', }, + { + href: 'https://atomgit.com/IvorySQL/IvorySQL', + label: 'GitCode', + }, ] }, { @@ -262,4 +269,4 @@ const config = { }), }; -module.exports = config; \ No newline at end of file +module.exports = config; From 8592751dc8ecd01b4d7aa75b0832ae2d289a55b9 Mon Sep 17 00:00:00 2001 From: faweizhao26 Date: Sat, 28 Feb 2026 19:13:41 +0800 Subject: [PATCH 2/2] fix Signed-off-by: faweizhao26 --- docusaurus.config.js | 7 ++----- src/pages/docs-ecosystem.js | 35 ++++++++++++++++++++++++++++++++++ src/pages/docs-installation.js | 35 ++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 src/pages/docs-ecosystem.js create mode 100644 src/pages/docs-installation.js diff --git a/docusaurus.config.js b/docusaurus.config.js index 38862a5..300a358 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -1,8 +1,5 @@ const lightCodeTheme = require('prism-react-renderer/themes/github'); const darkCodeTheme = require('prism-react-renderer/themes/dracula'); -const currentLocale = process.env.DOCUSAURUS_CURRENT_LOCALE || 'en'; -const docsLocaleSegment = currentLocale === 'zh-CN' ? 'cn' : 'en'; -const docsBaseUrl = `https://docs.ivorysql.org/${docsLocaleSegment}/ivorysql-doc/v5.1/v5.1`; /** @type {import('@docusaurus/types').Config} */ const config = { @@ -123,7 +120,7 @@ const config = { }, { label: 'Installation', - href: `${docsBaseUrl}/3.1#quick-installation`, + to: '/docs-installation', }, { label: 'Contribution Guidelines', @@ -149,7 +146,7 @@ const config = { }, { label: 'Ecological Cooperation', - href: `${docsBaseUrl}/5.0`, + to: '/docs-ecosystem', position: 'left' }, { diff --git a/src/pages/docs-ecosystem.js b/src/pages/docs-ecosystem.js new file mode 100644 index 0000000..a910477 --- /dev/null +++ b/src/pages/docs-ecosystem.js @@ -0,0 +1,35 @@ +import React, { useEffect } from 'react'; +import Layout from '@theme/Layout'; +import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; + +const DOCS_BASE = 'https://docs.ivorysql.org'; +const DOCS_VERSION = 'v5.1/v5.1'; + +function buildTarget(locale) { + const normalizedLocale = (locale || 'en').toLowerCase(); + const docsLocaleSegment = normalizedLocale.startsWith('zh') ? 'cn' : 'en'; + return `${DOCS_BASE}/${docsLocaleSegment}/ivorysql-doc/${DOCS_VERSION}/5.0`; +} + +export default function DocsEcosystemRedirect() { + const { i18n } = useDocusaurusContext(); + const target = buildTarget(i18n.currentLocale); + + useEffect(() => { + if (typeof window === 'undefined') { + return; + } + window.location.replace(target); + }, [target]); + + return ( + +
+

Redirecting to documentation...

+

+ If you are not redirected, click here. +

+
+
+ ); +} diff --git a/src/pages/docs-installation.js b/src/pages/docs-installation.js new file mode 100644 index 0000000..0cec2d1 --- /dev/null +++ b/src/pages/docs-installation.js @@ -0,0 +1,35 @@ +import React, { useEffect } from 'react'; +import Layout from '@theme/Layout'; +import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; + +const DOCS_BASE = 'https://docs.ivorysql.org'; +const DOCS_VERSION = 'v5.1/v5.1'; + +function buildTarget(locale) { + const normalizedLocale = (locale || 'en').toLowerCase(); + const docsLocaleSegment = normalizedLocale.startsWith('zh') ? 'cn' : 'en'; + return `${DOCS_BASE}/${docsLocaleSegment}/ivorysql-doc/${DOCS_VERSION}/3.1#quick-installation`; +} + +export default function DocsInstallationRedirect() { + const { i18n } = useDocusaurusContext(); + const target = buildTarget(i18n.currentLocale); + + useEffect(() => { + if (typeof window === 'undefined') { + return; + } + window.location.replace(target); + }, [target]); + + return ( + +
+

Redirecting to documentation...

+

+ If you are not redirected, click here. +

+
+
+ ); +}