Merge pull request #2451 from greyair/main

添加页面可以隐藏评论的属性
This commit is contained in:
tangly1024
2024-05-31 15:18:44 +08:00
committed by GitHub
2 changed files with 6 additions and 0 deletions

View File

@@ -121,6 +121,11 @@ const Comment = ({ frontMatter, className }) => {
return null
}
// 特定文章关闭评论区
if (frontMatter?.comment === 'Hide') {
return null
}
return (
<div
key={frontMatter?.id}

View File

@@ -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)