Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,5 @@
"engines": {
"node": ">=18.0"
},
"packageManager": "pnpm@10.12.1"
"packageManager": "pnpm@10.24.0+sha512.01ff8ae71b4419903b65c60fb2dc9d34cf8bb6e06d03bde112ef38f7a34d6904c424ba66bea5cdcf12890230bf39f9580473140ed9c946fef328b6e5238a345a"
}
10 changes: 4 additions & 6 deletions src/components/GlobalContent.js
Original file line number Diff line number Diff line change
@@ -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
}