Renders the site's favicons and web manifest from its emoji. The icons
task (api/scripts/generate-icons.ts) runs it before the server starts, so
the emoji can change without a rebuild.
The glyph comes from Twemoji as plain vector paths, so rendering it needs no emoji font, which the Alpine runtime image lacks.
Returns the name Twemoji files emoji under: its codepoints in hex, joined
with "-", without variation selectors (FE0F) unless the emoji is a ZWJ
sequence. lib/index-html.ts also uses it as the icon URLs' cache-busting
version.
Writes favicon.svg, favicon.ico, favicon-<size>x<size>.png (16 to 512),
apple-touch-icon.png and manifest.webmanifest into opts.outDir, the
directory the site's static files are served from.
Passed to generateSiteIcons by api/scripts/generate-icons.ts, from
the site's config.
-
bgColor: string
Fills the Apple touch icon, and the manifest's theme and background.
- emoji: string
-
outDir: string
Created if missing.
- siteName: string
Usage
import * as mod from "api/lib/site-icons.ts";