From 137d55eb1b64e87ff6f3cec52786e5e1bb68798e Mon Sep 17 00:00:00 2001
From: Ben Schlegel <31989404+benschlegel@users.noreply.github.com>
Date: Tue, 12 Nov 2024 12:33:35 +0000
Subject: [PATCH] feat(open-graph): generate OG images + further OG support (#740)

---
 quartz/components/Comments.tsx |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/quartz/components/Comments.tsx b/quartz/components/Comments.tsx
index 44331cc..5f379a1 100644
--- a/quartz/components/Comments.tsx
+++ b/quartz/components/Comments.tsx
@@ -25,7 +25,14 @@
 }
 
 export default ((opts: Options) => {
-  const Comments: QuartzComponent = ({ displayClass, cfg }: QuartzComponentProps) => {
+  const Comments: QuartzComponent = ({ displayClass, fileData, cfg }: QuartzComponentProps) => {
+    // check if comments should be displayed according to frontmatter
+    const commentsFlag: boolean =
+      fileData.frontmatter?.comments === true || fileData.frontmatter?.comments === "true"
+    if (!commentsFlag) {
+      return <></>
+    }
+
     return (
       <div
         class={classNames(displayClass, "giscus")}

--
Gitblit v1.10.0