From 200ddc0ea504dc242555a4c5f2cd50cdeee682bb Mon Sep 17 00:00:00 2001 From: Emile Bangma Date: Sun, 1 Dec 2024 00:39:46 +0000 Subject: [PATCH] fix(comments): only hide Giscus if comments == false is explicitly set in frontmatter --- quartz/components/Comments.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quartz/components/Comments.tsx b/quartz/components/Comments.tsx index 5f29860c29e60..0bfd82d2d5b0a 100644 --- a/quartz/components/Comments.tsx +++ b/quartz/components/Comments.tsx @@ -28,7 +28,8 @@ export default ((opts: Options) => { const Comments: QuartzComponent = ({ displayClass, fileData, cfg }: QuartzComponentProps) => { // check if comments should be displayed according to frontmatter const disableComment: boolean = - !fileData.frontmatter?.comments || fileData.frontmatter?.comments === "false" + typeof fileData.frontmatter?.comments !== "undefined" && + (!fileData.frontmatter?.comments || fileData.frontmatter?.comments === "false") if (disableComment) { return <> }