diff --git a/scripts/docs.js b/scripts/docs.js index 73186fbe..c429f275 100644 --- a/scripts/docs.js +++ b/scripts/docs.js @@ -1,5 +1,5 @@ // builds the documentation site into docs/ with typedoc, then adds what typedoc can't: a description and link previews -// (Open Graph) on every page, the icons browsers look for at the root, the README's wordmark following the docs' theme, +// (Open Graph) on every page, structured data (JSON-LD) on the start page, the icons browsers look for at the root, the README's wordmark following the docs' theme, // and redirects from the pages of the old jsdoc site (imagescript.dev/Image.html#resize -> classes/Image.html#resize) // so existing links keep working const fs = require('fs'); @@ -14,7 +14,7 @@ fs.rmSync(out, { recursive: true, force: true }); execFileSync(process.execPath, [typedoc], { cwd: root, stdio: 'inherit' }); const site = 'https://imagescript.dev/'; -const description = 'Pure TypeScript image processing that runs everywhere: Node.js, Deno, Bun, browsers and edge runtimes'; +const description = 'Decode, resize, edit and encode PNG, JPEG, WebP, AVIF and GIF in pure TypeScript. No dependencies; runs on Node.js, Deno, Bun, browsers and edge runtimes.'; for (const file of ['favicon.ico', 'apple-touch-icon.png', 'social-preview.png']) fs.copyFileSync(path.join(root, 'media', file), path.join(out, file)); @@ -23,10 +23,29 @@ const pages = fs.readdirSync(out, { recursive: true }).filter(file => file.endsW for (const page of pages) { const file = path.join(out, page); let html = fs.readFileSync(file, 'utf8'); - const title = html.match(/