chore(comments): cleanup logic

This commit is contained in:
David Fischer 2024-11-05 09:30:28 +01:00
parent b36f389eb8
commit 73b83a8768
No known key found for this signature in database
GPG Key ID: F21F2016DEFEC73D

View File

@ -31,7 +31,7 @@ export default ((opts: Options) => {
const commentsFlag: boolean =
fileData.frontmatter?.comments === true || fileData.frontmatter?.comments === "true"
if ((opts.respectFrontmatter ?? false) && !commentsFlag) {
return null
return <></>
}
return (
@ -54,10 +54,7 @@ export default ((opts: Options) => {
)
}
// make sure we actually need to load the script
if (Comments != null) {
Comments.afterDOMLoaded = script
}
Comments.afterDOMLoaded = script
return Comments
}) satisfies QuartzComponentConstructor<Options>