Skip to content

Commit e16142f

Browse files
authored
Merge pull request tangly1024#2451 from greyair/main
添加页面可以隐藏评论的属性
2 parents f679a3d + 290b38a commit e16142f

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

components/Comment.js

+5
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ const Comment = ({ frontMatter, className }) => {
121121
return null
122122
}
123123

124+
// 特定文章关闭评论区
125+
if (frontMatter?.comment === 'Hide') {
126+
return null
127+
}
128+
124129
return (
125130
<div
126131
key={frontMatter?.id}

lib/notion/getPageProperties.js

+1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ export default async function getPageProperties(
9494
properties.type = properties.type?.[0] || ''
9595
properties.status = properties.status?.[0] || ''
9696
properties.category = properties.category?.[0] || ''
97+
properties.comment = properties.comment?.[0] || ''
9798

9899
// 映射值:用户个性化type和status字段的下拉框选项,在此映射回代码的英文标识
99100
mapProperties(properties)

0 commit comments

Comments
 (0)