// One-off generator for the Minstrel OG / share-preview placeholder. // Run with: cd tools && npm install && npm run gen-og-placeholder // // Produces ../web/static/brand/og-image.png at 1200x630, the standard // OpenGraph aspect. The artwork is intentionally minimal — operators // are encouraged to drop a hand-designed PNG over the same path; no // code change is required to swap. import sharp from 'sharp'; import { mkdir } from 'node:fs/promises'; import { resolve, dirname } from 'node:path'; import { fileURLToPath } from 'node:url'; const __dirname = dirname(fileURLToPath(import.meta.url)); const outPath = resolve(__dirname, '../web/static/brand/og-image.png'); const W = 1200; const H = 630; const OBSIDIAN = '#14171A'; const PARCHMENT = '#E8E4D8'; const ACCENT = '#4A6B5C'; const svg = ` Minstrel Self-hosted music server `; await mkdir(dirname(outPath), { recursive: true }); await sharp(Buffer.from(svg)) .png({ compressionLevel: 9 }) .toFile(outPath); console.log(`wrote ${outPath}`);