From ab80eba7941eb7dbf4944ec63d52e1bfc7925ddc Mon Sep 17 00:00:00 2001
From: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
Date: Sat, 10 Feb 2024 22:19:17 +0000
Subject: [PATCH] chore(callouts): remove unnecessary whitespaces after class name (#833)
---
quartz/plugins/emitters/assets.ts | 27 +++++++++++++++++++++++----
1 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/quartz/plugins/emitters/assets.ts b/quartz/plugins/emitters/assets.ts
index 0f7f3e4..379cd5b 100644
--- a/quartz/plugins/emitters/assets.ts
+++ b/quartz/plugins/emitters/assets.ts
@@ -1,8 +1,9 @@
-import { FilePath, joinSegments, slugifyFilePath } from "../../path"
+import { FilePath, joinSegments, slugifyFilePath } from "../../util/path"
import { QuartzEmitterPlugin } from "../types"
import path from "path"
import fs from "fs"
-import { glob } from "../../glob"
+import { glob } from "../../util/glob"
+import DepGraph from "../../depgraph"
export const Assets: QuartzEmitterPlugin = () => {
return {
@@ -10,7 +11,25 @@
getQuartzComponents() {
return []
},
- async emit({ argv, cfg }, _content, _resources, _emit): Promise<FilePath[]> {
+ async getDependencyGraph(ctx, _content, _resources) {
+ const { argv, cfg } = ctx
+ const graph = new DepGraph<FilePath>()
+
+ const fps = await glob("**", argv.directory, ["**/*.md", ...cfg.configuration.ignorePatterns])
+
+ for (const fp of fps) {
+ const ext = path.extname(fp)
+ const src = joinSegments(argv.directory, fp) as FilePath
+ const name = (slugifyFilePath(fp as FilePath, true) + ext) as FilePath
+
+ const dest = joinSegments(argv.output, name) as FilePath
+
+ graph.addEdge(src, dest)
+ }
+
+ return graph
+ },
+ async emit({ argv, cfg }, _content, _resources): Promise<FilePath[]> {
// glob all non MD/MDX/HTML files in content folder and copy it over
const assetsPath = argv.output
const fps = await glob("**", argv.directory, ["**/*.md", ...cfg.configuration.ignorePatterns])
@@ -18,7 +37,7 @@
for (const fp of fps) {
const ext = path.extname(fp)
const src = joinSegments(argv.directory, fp) as FilePath
- const name = (slugifyFilePath(fp as FilePath) + ext) as FilePath
+ const name = (slugifyFilePath(fp as FilePath, true) + ext) as FilePath
const dest = joinSegments(assetsPath, name) as FilePath
const dir = path.dirname(dest) as FilePath
--
Gitblit v1.10.0