// Renders tools/social-card.html to public/social-card-v4.png at 1200x630.
// Run from site/: node tools/social-card.mjs
import { createRequire } from 'node:module'
import { fileURLToPath } from 'node:url'
const { chromium } = createRequire(import.meta.url)('playwright')
const browser = await chromium.launch()
const page = await browser.newPage({ viewport: { width: 1200, height: 630 }, deviceScaleFactor: 1 })
await page.goto(new URL('./social-card.html', import.meta.url).href)
await page.evaluate(() => document.fonts.ready)
await page.screenshot({ path: fileURLToPath(new URL('../public/social-card-v4.png', import.meta.url)) })
await browser.close()