The Trans Directory
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(favicon): add plugin to expose favicon from icon.png (#1942)

* feat(favicon): add plugin to expose favicon from icon.png

* chore(favicon): clean up formatting and remove unnecessary line breaks

authored by

dralagen and committed by
GitHub
9e588577 4bd714b7

+18
+1
quartz.config.ts
··· 86 86 }), 87 87 Plugin.Assets(), 88 88 Plugin.Static(), 89 + Plugin.Favicon(), 89 90 Plugin.NotFoundPage(), 90 91 // Comment out CustomOgImages to speed up build time 91 92 Plugin.CustomOgImages(),
+16
quartz/plugins/emitters/favicon.ts
··· 1 + import sharp from "sharp" 2 + import { joinSegments, QUARTZ, FilePath } from "../../util/path" 3 + import { QuartzEmitterPlugin } from "../types" 4 + 5 + export const Favicon: QuartzEmitterPlugin = () => ({ 6 + name: "Favicon", 7 + async *emit({ argv }) { 8 + const iconPath = joinSegments(QUARTZ, "static", "icon.png") 9 + const dest = joinSegments(argv.output, "favicon.ico") as FilePath 10 + 11 + await sharp(iconPath).resize(48, 48).toFormat("png").toFile(dest) 12 + 13 + yield dest 14 + }, 15 + async *partialEmit() {}, 16 + })
+1
quartz/plugins/emitters/index.ts
··· 5 5 export { AliasRedirects } from "./aliases" 6 6 export { Assets } from "./assets" 7 7 export { Static } from "./static" 8 + export { Favicon } from "./favicon" 8 9 export { ComponentResources } from "./componentResources" 9 10 export { NotFoundPage } from "./404" 10 11 export { CNAME } from "./cname"