mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-05-18 14:34:23 +02:00
fix(comments): properly check if comments is in frontmatter (#1627)
This commit is contained in:
parent
e1d754ef79
commit
7ac94e1d84
@ -28,7 +28,8 @@ export default ((opts: Options) => {
|
|||||||
const Comments: QuartzComponent = ({ displayClass, fileData, cfg }: QuartzComponentProps) => {
|
const Comments: QuartzComponent = ({ displayClass, fileData, cfg }: QuartzComponentProps) => {
|
||||||
// check if comments should be displayed according to frontmatter
|
// check if comments should be displayed according to frontmatter
|
||||||
const disableComment: boolean =
|
const disableComment: boolean =
|
||||||
!fileData.frontmatter?.comments || fileData.frontmatter?.comments === "false"
|
typeof fileData.frontmatter?.comments !== "undefined" &&
|
||||||
|
(!fileData.frontmatter?.comments || fileData.frontmatter?.comments === "false")
|
||||||
if (disableComment) {
|
if (disableComment) {
|
||||||
return <></>
|
return <></>
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user