From 86241e15254c817bc99b0b71fa0b55fbe039c168 Mon Sep 17 00:00:00 2001 From: GreyAir Date: Mon, 27 May 2024 08:25:08 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B5=E9=9D=A2=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E9=9A=90=E8=97=8F=E8=AF=84=E8=AE=BA=E7=9A=84=E5=B1=9E?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Comment.js | 136 ++++++++++++++++---------------- lib/notion/getPageProperties.js | 1 + 2 files changed, 70 insertions(+), 67 deletions(-) diff --git a/components/Comment.js b/components/Comment.js index ba0d4256..bc702c4d 100644 --- a/components/Comment.js +++ b/components/Comment.js @@ -121,82 +121,84 @@ const Comment = ({ frontMatter, className }) => { return null } - return ( -
- {/* 延迟加载评论区 */} - {!shouldLoad && ( -
- Loading... - -
- )} + if (frontMatter?.comment != 'Hide') { + return ( +
+ {/* 延迟加载评论区 */} + {!shouldLoad && ( +
+ Loading... + +
+ )} - {shouldLoad && ( - - {COMMENT_ARTALK_SERVER && ( -
- -
- )} + {shouldLoad && ( + + {COMMENT_ARTALK_SERVER && ( +
+ +
+ )} - {COMMENT_TWIKOO_ENV_ID && ( -
- -
- )} + {COMMENT_TWIKOO_ENV_ID && ( +
+ +
+ )} - {COMMENT_WALINE_SERVER_URL && ( -
- -
- )} + {COMMENT_WALINE_SERVER_URL && ( +
+ +
+ )} - {COMMENT_VALINE_APP_ID && ( -
- -
- )} + {COMMENT_VALINE_APP_ID && ( +
+ +
+ )} - {COMMENT_GISCUS_REPO && ( -
- -
- )} + {COMMENT_GISCUS_REPO && ( +
+ +
+ )} - {COMMENT_CUSDIS_APP_ID && ( -
- -
- )} + {COMMENT_CUSDIS_APP_ID && ( +
+ +
+ )} - {COMMENT_UTTERRANCES_REPO && ( -
- -
- )} + {COMMENT_UTTERRANCES_REPO && ( +
+ +
+ )} - {COMMENT_GITALK_CLIENT_ID && ( -
- -
- )} + {COMMENT_GITALK_CLIENT_ID && ( +
+ +
+ )} - {COMMENT_WEBMENTION_ENABLE && ( -
- -
- )} -
- )} -
- ) + {COMMENT_WEBMENTION_ENABLE && ( +
+ +
+ )} + + )} +
+ ) + } } export default Comment diff --git a/lib/notion/getPageProperties.js b/lib/notion/getPageProperties.js index 38eede18..17f88e4e 100644 --- a/lib/notion/getPageProperties.js +++ b/lib/notion/getPageProperties.js @@ -94,6 +94,7 @@ export default async function getPageProperties( properties.type = properties.type?.[0] || '' properties.status = properties.status?.[0] || '' properties.category = properties.category?.[0] || '' + properties.comment = properties.comment?.[0] || '' // 映射值:用户个性化type和status字段的下拉框选项,在此映射回代码的英文标识 mapProperties(properties)