From 6ae0bb0908b2408aee7c75ee9289413ab8606fa0 Mon Sep 17 00:00:00 2001 From: Aaron Pham <29749331+aarnphm@users.noreply.github.com> Date: Sat, 10 Feb 2024 17:17:41 -0500 Subject: [PATCH] chore: move fonts all into static folder (#835) * chore: move fonts all into static folder Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Jacky Zhao * chore: update formatter Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> --------- Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> Co-authored-by: Jacky Zhao --- quartz/plugins/emitters/componentResources.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/quartz/plugins/emitters/componentResources.ts b/quartz/plugins/emitters/componentResources.ts index c3a60b2..290cb6f 100644 --- a/quartz/plugins/emitters/componentResources.ts +++ b/quartz/plugins/emitters/componentResources.ts @@ -221,7 +221,10 @@ export const ComponentResources: QuartzEmitterPlugin = (opts?: Partial< // the static name of this file. const [filename, ext] = url.split("/").pop()!.split(".") - googleFontsStyleSheet = googleFontsStyleSheet.replace(url, `/fonts/${filename}.ttf`) + googleFontsStyleSheet = googleFontsStyleSheet.replace( + url, + `/static/fonts/${filename}.ttf`, + ) promises.push( fetch(url) @@ -234,7 +237,7 @@ export const ComponentResources: QuartzEmitterPlugin = (opts?: Partial< .then((buf) => write({ ctx, - slug: joinSegments("fonts", filename) as FullSlug, + slug: joinSegments("static", "fonts", filename) as FullSlug, ext: `.${ext}`, content: Buffer.from(buf), }),