diff --git a/quartz/components/Comments.tsx b/quartz/components/Comments.tsx index 9c734fd1b..91f83fc55 100644 --- a/quartz/components/Comments.tsx +++ b/quartz/components/Comments.tsx @@ -28,7 +28,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 - if ((opts.respectFrontmatter ?? false) && !(fileData.frontmatter?.comments ?? false)) { + const commentsFlag: boolean = + fileData.frontmatter?.comments === true || fileData.frontmatter?.comments === "true" + if ((opts.respectFrontmatter ?? false) && !commentsFlag) { return null } diff --git a/quartz/plugins/transformers/frontmatter.ts b/quartz/plugins/transformers/frontmatter.ts index 2e599aa0e..cf3880eff 100644 --- a/quartz/plugins/transformers/frontmatter.ts +++ b/quartz/plugins/transformers/frontmatter.ts @@ -93,6 +93,7 @@ declare module "vfile" { lang: string enableToc: string cssclasses: string[] + comments: boolean | string }> } }