mirror of
https://github.com/ZetaKebab/quartz.git
synced 2025-06-22 00:34:37 +00:00
feat(comments): conditional display via frontmatter (#1566)
This commit is contained in:
@ -25,7 +25,14 @@ function boolToStringBool(b: boolean): string {
|
||||
}
|
||||
|
||||
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")}
|
||||
|
Reference in New Issue
Block a user