mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 21:34:06 -06:00
chore(favicon): clean up formatting and remove unnecessary line breaks
This commit is contained in:
parent
afae0986af
commit
dae5430957
@ -1,19 +1,16 @@
|
|||||||
import sharp from "sharp";
|
import sharp from "sharp"
|
||||||
import { joinSegments, QUARTZ, FilePath } from "../../util/path";
|
import { joinSegments, QUARTZ, FilePath } from "../../util/path"
|
||||||
import { QuartzEmitterPlugin } from "../types";
|
import { QuartzEmitterPlugin } from "../types"
|
||||||
|
|
||||||
export const Favicon: QuartzEmitterPlugin = () => ({
|
export const Favicon: QuartzEmitterPlugin = () => ({
|
||||||
name: "Favicon",
|
name: "Favicon",
|
||||||
async *emit({ argv, cfg }) {
|
async *emit({ argv }) {
|
||||||
const iconPath = joinSegments(QUARTZ, "static", "icon.png")
|
const iconPath = joinSegments(QUARTZ, "static", "icon.png")
|
||||||
const dest = joinSegments(argv.output, "favicon.ico") as FilePath
|
const dest = joinSegments(argv.output, "favicon.ico") as FilePath
|
||||||
|
|
||||||
await sharp(iconPath)
|
|
||||||
.resize(48, 48)
|
|
||||||
.toFormat("png")
|
|
||||||
.toFile(dest)
|
|
||||||
|
|
||||||
yield dest
|
await sharp(iconPath).resize(48, 48).toFormat("png").toFile(dest)
|
||||||
},
|
|
||||||
async *partialEmit() {},
|
yield dest
|
||||||
})
|
},
|
||||||
|
async *partialEmit() {},
|
||||||
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user