Aaron Pham
2024-02-10 6ae0bb0908b2408aee7c75ee9289413ab8606fa0
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 <j.zhao2k19@gmail.com>

* 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 <j.zhao2k19@gmail.com>
1 files modified
7 ■■■■ changed files
quartz/plugins/emitters/componentResources.ts 7 ●●●● patch | view | raw | blame | history
quartz/plugins/emitters/componentResources.ts
@@ -221,7 +221,10 @@
            // 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 @@
                .then((buf) =>
                  write({
                    ctx,
                    slug: joinSegments("fonts", filename) as FullSlug,
                    slug: joinSegments("static", "fonts", filename) as FullSlug,
                    ext: `.${ext}`,
                    content: Buffer.from(buf),
                  }),