p4ni.

← All articles

#astro

  1. Comparison

    CSP Nonce vs Hash on a Static Site: The Edge Workaround Stamps the Attacker's Script Too

    The standard advice is to put a Worker in front of your static site and inject nonces with HTMLRewriter. I built it and measured what it does: it signs every inline script it finds, including the one you didn't write.

  2. Tutorial

    Japanese OG Images with Satori: The 5 MB Font You Never Ship

    Satori draws CJK text only if you hand it a font that has the glyphs — and it fails silently when you don't. Measured numbers for Noto Sans JP: subset size, weight pairing, per-card cost, and why the 5 MB never reaches the CDN.

  3. Comparison

    Choosing a CMS for Astro on Cloudflare: Git-Based, Headless, or None at All

    Astro on Cloudflare Workers doesn't dictate a CMS — it dictates a build. How content collections, git-based CMSes, hosted headless platforms, and a DIY D1 setup each fit that constraint, and how to pick between them.

  4. Tutorial

    Astro i18n Without a Plugin: Bilingual Content Collections

    How I added Japanese to this blog with no i18n plugin: locale folders in one collection, translation pairing by slug, hreflang, and a typed UI dictionary.

  5. Tutorial

    How to Add llms.txt to an Astro Site (Generated, Not Hand-Written)

    Generate llms.txt and llms-full.txt from Astro content collections so they never go stale — endpoint code included, and an honest look at whether anything reads them yet.

  6. Tutorial

    How to Schedule Blog Posts on a Static Astro Site

    No server, no CMS, no paid service — schedule posts on a static Astro site with a pubDate filter and a daily GitHub Actions rebuild. Timezone gotcha included.

  7. Tutorial

    A Strict CSP for Astro on Cloudflare Workers (No Nonce Required)

    Static sites can't mint a nonce, so inline scripts need hashes. My inline script blocks grow with every post, but the policy needs exactly 3 hashes — and the reason why is the part most CSP guides get wrong.

  8. Build in Public

    Astro 7 Agent Detection: What Triggers It, What It Breaks

    Astro 7 backgrounds astro dev when it detects an AI coding agent. What actually triggers it, what the JSON logs really contain, and how to turn it off.

  9. Comparison

    Astro vs Next.js in 2026: Which One for a Content Site?

    I measured what each framework ships by default: 645 bytes vs 642 kB. What that gap means for a blog, docs site, or directory — and when Next.js is still the better call.

  10. Tutorial

    Astro Structured Data: The JSON-LD Google Still Uses

    FAQ rich results died in May 2026, HowTo in 2023. The structured data that still earns you something, and how to emit it from Astro content collections.

  11. Tutorial

    Auto-Generate Open Graph Images in Astro with Satori

    Generate a 1200x630 OG image for every post at build time — no headless browser, no runtime cost. The full Astro + Satori setup, font gotchas included.

  12. Build in Public

    Fixing Web Font LCP in Astro: PageSpeed 83 → 99

    Inlining the stylesheet was the easy win. The real problem was preloading fonts to hide a layout shift — and the metric overrides that fixed LCP instead.

  13. Comparison

    The Best Astro Directory Themes in 2026

    Free Markdown starters vs. database-backed themes with admin panels. Comparing the Astro directory themes worth using, and how to pick your data layer.

  14. Tutorial

    Deploy an Astro Site to Cloudflare Workers (2026 Guide)

    Cloudflare now points new projects at Workers, not Pages. The current way to deploy a static Astro site: static assets, a custom domain, zero server code.