mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-28 07:14:05 -06:00
Excalidraw embed image Proof of Concept
This commit is contained in:
parent
01fc26d2c0
commit
bf9d0092a9
9
quartz/plugins/filters/excalidraw.ts
Normal file
9
quartz/plugins/filters/excalidraw.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import { QuartzFilterPlugin } from "../types"
|
||||
|
||||
export const RemoveExcalidrawMarkdown: QuartzFilterPlugin = () => ({
|
||||
name: "RemoveExcalidrawMarkdown",
|
||||
shouldPublish(_ctx, [_tree, vfile]) {
|
||||
const publishFlag: boolean = !vfile.basename?.match(/\.excalidraw\./) || false
|
||||
return !publishFlag
|
||||
},
|
||||
})
|
||||
@ -1,2 +1,3 @@
|
||||
export { RemoveDrafts } from "./draft"
|
||||
export { RemoveExcalidrawMarkdown } from "./excalidraw"
|
||||
export { ExplicitPublish } from "./explicit"
|
||||
|
||||
@ -226,6 +226,11 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>>
|
||||
const anchor = rawHeader?.trim() ?? ""
|
||||
const alias = rawAlias?.slice(1).trim()
|
||||
|
||||
// excalidraw
|
||||
if (fp.match(/\.excalidraw\./)) {
|
||||
fp.replace(".excalidraw", "")
|
||||
}
|
||||
|
||||
// embed cases
|
||||
if (value.startsWith("!")) {
|
||||
const ext: string = path.extname(fp).toLowerCase()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user