fix(comment): negate check (closes #1582) (#1586)

This commit is contained in:
Aaron Pham 2024-11-14 06:28:06 -05:00 committed by GitHub
parent 137d55eb1b
commit f24a147276
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -27,9 +27,9 @@ function boolToStringBool(b: boolean): string {
export default ((opts: Options) => {
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) {
const disableComment: boolean =
!fileData.frontmatter?.comments || fileData.frontmatter?.comments === "false"
if (disableComment) {
return <></>
}