diff --git a/package.json b/package.json index c1f0fc711..1e5287108 100644 --- a/package.json +++ b/package.json @@ -86,5 +86,5 @@ "engines": { "node": ">=18.0" }, - "packageManager": "pnpm@10.12.1" + "packageManager": "pnpm@10.24.0+sha512.01ff8ae71b4419903b65c60fb2dc9d34cf8bb6e06d03bde112ef38f7a34d6904c424ba66bea5cdcf12890230bf39f9580473140ed9c946fef328b6e5238a345a" } diff --git a/src/components/GlobalContent.js b/src/components/GlobalContent.js index 81f1330cf..187c5ebd1 100644 --- a/src/components/GlobalContent.js +++ b/src/components/GlobalContent.js @@ -1,15 +1,13 @@ import React from "react"; import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; -const IS_CHINA_SITE = process.env.CHINA === "true"; - /** - * A component that conditionally renders its children based on the CHINA environment variable. - * If CHINA is 'true', the children (typically Markdown content) will not be rendered. + * A component that conditionally renders its children based on the `IS_CHINA_SITE` environment variable. + * If `IS_CHINA_SITE` is 'true', the children (typically Markdown content) will not be rendered. */ export default function GlobalContent({ children }) { - if (IS_CHINA_SITE) { - return null; // Do not render children if in China site context + if (useDocusaurusContext().siteConfig.customFields.IS_CHINA_SITE) { + return null; // Do not render children if in the China site context } return <>{children}; // Render children otherwise }