v3: added customizable site emoji (logo), small visual tweaks
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 41s
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 41s
This commit is contained in:
27
api/scripts/generate-icons.ts
Normal file
27
api/scripts/generate-icons.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
// Generates the favicon set + manifest from the runtime GERBEUR_SITE_EMOJI.
|
||||
// Runs before the server starts, so changing the emoji only requires a restart
|
||||
// — no rebuild.
|
||||
//
|
||||
// The output directory is passed as the first argument (relative to cwd):
|
||||
// - prod (`deno task start` / `serve`): `dist` — what the Oak server serves
|
||||
// - dev (`deno task dev`): `public` — what the Vite server serves
|
||||
// Defaults to `dist` when omitted.
|
||||
import { OG_SITE_NAME, SITE_EMOJI, THEME_COLOR } from "../config.ts";
|
||||
import { generateSiteIcons } from "../lib/site-icons.ts";
|
||||
|
||||
const outDir = `${Deno.cwd()}/${Deno.args[0] ?? "dist"}`;
|
||||
|
||||
try {
|
||||
await Deno.stat(outDir);
|
||||
} catch {
|
||||
console.log(`[icons] ${outDir} not found — skipping favicon generation.`);
|
||||
Deno.exit(0);
|
||||
}
|
||||
|
||||
await generateSiteIcons({
|
||||
emoji: SITE_EMOJI,
|
||||
outDir,
|
||||
siteName: OG_SITE_NAME,
|
||||
bgColor: THEME_COLOR,
|
||||
});
|
||||
console.log(`[icons] Generated favicons for "${SITE_EMOJI}" into ${outDir}`);
|
||||
Reference in New Issue
Block a user