mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-26 13:26:22 +00:00
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>
This commit is contained in:
parent
db5e701810
commit
6ae0bb0908
1 changed files with 5 additions and 2 deletions
|
@ -221,7 +221,10 @@ export const ComponentResources: QuartzEmitterPlugin<Options> = (opts?: Partial<
|
||||||
// the static name of this file.
|
// the static name of this file.
|
||||||
const [filename, ext] = url.split("/").pop()!.split(".")
|
const [filename, ext] = url.split("/").pop()!.split(".")
|
||||||
|
|
||||||
googleFontsStyleSheet = googleFontsStyleSheet.replace(url, `/fonts/${filename}.ttf`)
|
googleFontsStyleSheet = googleFontsStyleSheet.replace(
|
||||||
|
url,
|
||||||
|
`/static/fonts/${filename}.ttf`,
|
||||||
|
)
|
||||||
|
|
||||||
promises.push(
|
promises.push(
|
||||||
fetch(url)
|
fetch(url)
|
||||||
|
@ -234,7 +237,7 @@ export const ComponentResources: QuartzEmitterPlugin<Options> = (opts?: Partial<
|
||||||
.then((buf) =>
|
.then((buf) =>
|
||||||
write({
|
write({
|
||||||
ctx,
|
ctx,
|
||||||
slug: joinSegments("fonts", filename) as FullSlug,
|
slug: joinSegments("static", "fonts", filename) as FullSlug,
|
||||||
ext: `.${ext}`,
|
ext: `.${ext}`,
|
||||||
content: Buffer.from(buf),
|
content: Buffer.from(buf),
|
||||||
}),
|
}),
|
||||||
|
|
Loading…
Reference in a new issue