Merge branch 'v4' of https://github.com/jackyzha0/quartz into markdown-parser-rework-rework

This commit is contained in:
saberzero1 2024-10-22 22:51:56 +02:00
commit 78512db5f1
No known key found for this signature in database
GPG Key ID: 41AEE99107640F10
3 changed files with 5 additions and 4 deletions

View File

@ -3,7 +3,8 @@ import { QuartzFilterPlugin } from "../types"
export const RemoveDrafts: QuartzFilterPlugin<{}> = () => ({
name: "RemoveDrafts",
shouldPublish(_ctx, [_tree, vfile]) {
const draftFlag: boolean = vfile.data?.frontmatter?.draft === true
const draftFlag: boolean =
vfile.data?.frontmatter?.draft === true || vfile.data?.frontmatter?.draft === "true"
return !draftFlag
},
})

View File

@ -3,6 +3,6 @@ import { QuartzFilterPlugin } from "../types"
export const ExplicitPublish: QuartzFilterPlugin = () => ({
name: "ExplicitPublish",
shouldPublish(_ctx, [_tree, vfile]) {
return vfile.data?.frontmatter?.publish === true
return vfile.data?.frontmatter?.publish === true || vfile.data?.frontmatter?.publish === "true"
},
})

View File

@ -88,8 +88,8 @@ declare module "vfile" {
tags: string[]
aliases: string[]
description: string
publish: boolean
draft: boolean
publish: boolean | string
draft: boolean | string
lang: string
enableToc: string
cssclasses: string[]