mirror of
https://gitlab.com/MisterBiggs/brain-quartz.git
synced 2025-07-24 15:21:25 +00:00
.github
content
docs
quartz
cli
components
i18n
plugins
emitters
404.tsx
aliases.ts
assets.ts
cname.ts
componentResources.ts
contentIndex.tsx
contentPage.tsx
favicon.ts
folderPage.tsx
helpers.ts
index.ts
ogImage.tsx
static.ts
tagPage.tsx
filters
transformers
index.ts
types.ts
vfile.ts
processors
static
styles
util
bootstrap-cli.mjs
bootstrap-worker.mjs
build.ts
cfg.ts
worker.ts
.gitattributes
.gitignore
.gitlab-ci.yml
.gitmodules
.node-version
.npmrc
.prettierignore
.prettierrc
CODE_OF_CONDUCT.md
Dockerfile
LICENSE.txt
README.md
bun.lock
globals.d.ts
index.d.ts
package-lock.json
package.json
quartz.config.ts
quartz.layout.ts
tsconfig.json
* doc(favicon): add documentation of favicon plugin * doc(favicon): add missing link to configuration page * fix(favicon): build on public folder don't created
23 lines
631 B
TypeScript
23 lines
631 B
TypeScript
import sharp from "sharp"
|
|
import { joinSegments, QUARTZ, FullSlug } from "../../util/path"
|
|
import { QuartzEmitterPlugin } from "../types"
|
|
import { write } from "./helpers"
|
|
import { BuildCtx } from "../../util/ctx"
|
|
|
|
export const Favicon: QuartzEmitterPlugin = () => ({
|
|
name: "Favicon",
|
|
async *emit({ argv }) {
|
|
const iconPath = joinSegments(QUARTZ, "static", "icon.png")
|
|
|
|
const faviconContent = sharp(iconPath).resize(48, 48).toFormat("png")
|
|
|
|
yield write({
|
|
ctx: { argv } as BuildCtx,
|
|
slug: "favicon" as FullSlug,
|
|
ext: ".ico",
|
|
content: faviconContent,
|
|
})
|
|
},
|
|
async *partialEmit() {},
|
|
})
|