Repo

astro-d1-search turns your markdown into a Cloudflare D1 full-text index and gives your Astro site a search API on top of it.

There are three moving parts, and these guides walk through them in order:

  1. The integration — added to astro.config.mjs. It injects the /api/search route and hands your ranking config to it.
  2. The indexer — a build-time script that parses your content, generates SQL, and pushes it to D1 through wrangler.
  3. The query layer — either the injected HTTP endpoint, or searchIndex() called directly from a server-rendered page.

Prerequisites

In this section

Theme

Copy this CSS to your project: