Skip to content

Commit

Permalink
Merge pull request #2451 from greyair/main
Browse files Browse the repository at this point in the history
添加页面可以隐藏评论的属性
  • Loading branch information
tangly1024 committed May 31, 2024
2 parents f679a3d + 290b38a commit e16142f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/Comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ const Comment = ({ frontMatter, className }) => {
return null
}

// 特定文章关闭评论区
if (frontMatter?.comment === 'Hide') {
return null
}

return (
<div
key={frontMatter?.id}
Expand Down
1 change: 1 addition & 0 deletions lib/notion/getPageProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e16142f

Please sign in to comment.