All checks were successful
Deploy info-canicule / deploy (push) Successful in 1m31s
- favicon.svg : nouveau logo (sun + brand + droplet) cohérent avec le header - favicon-32 / favicon-192 / apple-touch-icon générés par scripts/build-favicon.mjs (sharp) - og-image refait avec la nouvelle identité (paper, Manrope-like, pills vigilance avec glyphes) - Base.astro : link rel icon + apple-touch-icon ajoutés - /soutenir : reskin (kicker + h1 accentué + barre d'objectif en brand-tint, blocs ic-card), fonctionnalité Ko-fi conservée Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
27 lines
989 B
JavaScript
27 lines
989 B
JavaScript
#!/usr/bin/env node
|
||
// Génère les fallbacks PNG du favicon (apple-touch-icon + 32px) depuis public/favicon.svg.
|
||
// Lancé à la demande quand le SVG change : `node scripts/build-favicon.mjs`.
|
||
|
||
import sharp from 'sharp';
|
||
import { readFileSync } from 'node:fs';
|
||
import { resolve, dirname } from 'node:path';
|
||
import { fileURLToPath } from 'node:url';
|
||
|
||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||
const SVG = resolve(__dirname, '../public/favicon.svg');
|
||
const buf = readFileSync(SVG);
|
||
|
||
const outputs = [
|
||
{ path: '../public/apple-touch-icon.png', size: 180 },
|
||
{ path: '../public/favicon-32.png', size: 32 },
|
||
{ path: '../public/favicon-192.png', size: 192 },
|
||
];
|
||
|
||
for (const o of outputs) {
|
||
const dest = resolve(__dirname, o.path);
|
||
await sharp(buf, { density: 384 })
|
||
.resize(o.size, o.size, { fit: 'contain', background: { r: 0, g: 0, b: 0, alpha: 0 } })
|
||
.png({ compressionLevel: 9 })
|
||
.toFile(dest);
|
||
console.log(`Wrote ${dest} (${o.size}×${o.size})`);
|
||
}
|