mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-27 14:54:05 -06:00
feat(comments): support true string values for comments
This commit is contained in:
parent
2aac704812
commit
b36f389eb8
@ -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
|
||||
}
|
||||
|
||||
|
||||
@ -93,6 +93,7 @@ declare module "vfile" {
|
||||
lang: string
|
||||
enableToc: string
|
||||
cssclasses: string[]
|
||||
comments: boolean | string
|
||||
}>
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user