Skip to content

Commit

Permalink
docs:update scripts (#4925)
Browse files Browse the repository at this point in the history
* docs:update scripts

* update
  • Loading branch information
zjy365 authored Jul 25, 2024
1 parent 3127c81 commit 93c5a9a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
14 changes: 9 additions & 5 deletions docs/website/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require('dotenv').config()

const generateAlgoliKey = () => "ce5b8e1e4d0d35ff587caf75ac404df4"
const isChinese = process.env.SEALOS_LANG === "zh-Hans"
const isDomesticSite = process.env.SEALOS_LANG === "zh-Hans"

/** @type {import('@docusaurus/types').Config} */
const config = {
Expand Down Expand Up @@ -64,9 +64,9 @@ const config = {
id: 'sealos_tip',
content: `
<div class="sealos-banner-box">
<div>${isChinese ? 'If you are an international user, please visit 👉' : '如果您是国内用户,请直接访问 👉 '}</div>
<div class="sealos-banner-btn" onclick="window.open('${isChinese ? 'https://sealos.io' : 'https://sealos.run'}', '_blank');">
${isChinese ? 'International Site' : '国内官网'}
<div>${isDomesticSite ? 'If you are an international user, please visit 👉' : '如果您是国内用户,请直接访问 👉 '}</div>
<div class="sealos-banner-btn" onclick="window.open('${isDomesticSite ? 'https://sealos.io' : 'https://sealos.run'}', '_blank');">
${isDomesticSite ? 'International Site' : '国内官网'}
</div>
<svg
onclick="handleBannerClose()"
Expand Down Expand Up @@ -232,7 +232,11 @@ const config = {
{
src: "/global.js",
async: true
}
},
...(isDomesticSite ? [{
src: 'https://hm.baidu.com/hm.js?d8e8ecf669c47dc2512d3f1417e761f9',
async: true,
}] : [])
],
headTags: [
{
Expand Down
5 changes: 0 additions & 5 deletions docs/website/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ const Home = () => {
script1.setAttribute('data-website-id', 'e5a8009f-7cb6-4841-9522-d23b96216b7a');
script1.async = true;
document.head.appendChild(script1);

const scriptBaidu = document.createElement('script');
scriptBaidu.src = 'https://hm.baidu.com/hm.js?d8e8ecf669c47dc2512d3f1417e761f9';
scriptBaidu.async = true;
document.head.appendChild(scriptBaidu);
} else {
const script2 = document.createElement('script');
script2.src = 'https://umami.cloud.sealos.io/oishii';
Expand Down

0 comments on commit 93c5a9a

Please sign in to comment.