astro-d1-search released on npm

The site search I built last month is now a package: astro-d1-search is an Astro integration that adds full-text search backed by Cloudflare D1 to any Astro site running on the Cloudflare adapter. Build-time indexing, an injected /api/search endpoint, bm25 + recency ranking, and a searchIndex() function for server-rendered search pages — all driven by one config object.

This site now runs on the package rather than its own copy of the code, which removed about 400 lines from the repo. There are docs, a repo, and an agent skill (npx skills add mrmartineau/astro-d1-search) so Claude Code can wire it up for you.

I wrote up the whole thing in astro-d1-search: site search for Astro in one integration.