From 108682b581e72a5dabbd8c837e14f54e0100aa25 Mon Sep 17 00:00:00 2001 From: Carson Yang Date: Thu, 26 Dec 2024 17:09:02 +0800 Subject: [PATCH] refactor(docs): simplify announcement bar configuration (#5314) Signed-off-by: yangchuansheng --- docs/website/docusaurus.config.js | 61 ++++++++++++++----------------- 1 file changed, 28 insertions(+), 33 deletions(-) diff --git a/docs/website/docusaurus.config.js b/docs/website/docusaurus.config.js index 5111941b46b..3a12ff3ab07 100644 --- a/docs/website/docusaurus.config.js +++ b/docs/website/docusaurus.config.js @@ -75,39 +75,34 @@ const config = { themeConfig: { // @type {import('@docusaurus/preset-classic').ThemeConfig} metadata: [{ name: 'title', content: 'Sealos by 环界云' }], - announcementBar: { - id: 'sealos_tip', - content: ` - (function() { - const hostname = window.location.hostname; - if (hostname !== 'sealos.run') { - document.write(\` -
-
${'如果您是国内用户,请直接访问 👉 '}
-
- ${'国内官网'} -
- - - - - - - - - - - - -
- \`); - } - })(); - `, - isCloseable: true, - }, + ...(isDomesticSite ? {} : { + announcementBar: { + id: 'sealos_tip', + content: ` +
+
如果您是国内用户,请直接访问 👉
+
+ 国内官网 +
+ + + + + + + + + + + + +
+ `, + isCloseable: true, + } + }), algolia: { // Algolia 提供的应用 ID appId: "SLTSB7B9Y0",