llms.txt Generator for Astro & Starlight Sites
Astro's zero-JS static HTML already gives you a massive head start with AI crawlers. Generate your /llms.txt and ship it via public/ or a static Astro endpoint.
Astro sites can drop a static file into public/llms.txt or auto-generate /llms.txt directly from Astro Content Collections at build time using src/pages/llms.txt.ts.
Step-by-Step Astro Setup
- 01
Scan your live Astro production domain above to audit metadata, sitemap-index.xml, and AI bot rules.
- 02
Copy the generated Markdown as your starter template or feed your Content Collections into src/pages/llms.txt.ts.
- 03
Add public/llms.txt (or the static endpoint below) and rebuild your Astro project.
- 04
Verify /llms.txt returns text/plain on Cloudflare Pages, Netlify, or Vercel.
import type { APIRoute } from "astro";
import { getCollection } from "astro:content";
export const GET: APIRoute = async ({ site }) => {
const docs = await getCollection("docs");
const origin = site?.toString().replace(/\/$/, "") ?? "https://yourdomain.com";
const links = docs
.slice(0, 30)
.map((entry) => `- [${entry.data.title}](${origin}/${entry.slug})`);
const content = [
"# Project Documentation",
"",
"> Official documentation and API reference.",
"",
"## Documentation & Guides",
...links,
].join("\n");
return new Response(content, {
headers: { "Content-Type": "text/plain; charset=utf-8" },
});
};Recommended Astro llms.txt Blueprint
Project overview, install guide, and architecture summary.
Top Starlight or Astro Content Collection pages sorted by reader priority.
Release notes, migration guides, and tutorials.
License, changelog, and community links.
Common Astro AI Search Pitfalls
Forgetting to install @astrojs/sitemap so crawlers miss new content collection routes.
Not configuring the site property in astro.config.mjs, causing missing canonical URLs.
Shipping Starlight docs without Organization or TechArticle JSON-LD in the custom head slot.
Astro llms.txt FAQs
Why do Astro sites typically score high on AI search readiness?
Astro ships clean, server-rendered semantic HTML with minimal client JavaScript, making it effortless for PerplexityBot, ClaudeBot, and OAI-SearchBot to parse without headless browser rendering.
Can I generate llms.txt automatically from Astro Content Collections?
Yes! Creating src/pages/llms.txt.ts lets Astro output a static /llms.txt file during astro build directly from your Markdown/MDX collections.
Does Starlight include an llms.txt file by default?
Not out of the box—you can add our generated file to public/llms.txt in 30 seconds or wire up the static endpoint snippet above.
Related Platform & GEO Guides
View all 24 guides →/llms.txt at docs root (static/llms.txt in Docusaurus, public/llms.txt in Nextra/Starlight)
public/llms.txt (static) or app/llms.txt/route.ts (dynamic)
public/llms.txt (Cloudflare Pages) or Edge Worker Route (/llms.txt)
public/llms.txt + optional vercel.json header rule
Free On-Demand Scanner. Automate When You Scale.
Generate and download /llms.txt free forever with zero login. Upgrade only when you want automated weekly syncs, crawler-block alerts, or agency client reports.
Everything you need to audit any public site and ship a clean /llms.txt today.
- Unlimited zero-login live domain scans
- 0–100 AI Search Visibility Score & breakdown
- 8-bot robots.txt AI crawler inspection
- Spec-compliant /llms.txt generator (Copy & Download)
- JSON-LD, canonical & semantic HTML audit
For SaaS teams, Shopify merchants, and publishers keeping AI search visibility continuously protected.
- Up to 3 monitored production domains
- Weekly auto-regenerated /llms.txt diffs & hosted URL
- Instant email/Slack alerts if any AI search bot gets blocked
- Sitemap & JSON-LD regression tracking
- Historical 0–100 GEO score trendline
Built for SEO agencies and web studios delivering client-ready GEO audits at scale.
- 25 client websites with weekly auto-monitoring
- White-label GEO Audit PDF exports for client pitches
- Multi-client AI crawler block alert digest
- Bulk /llms.txt regeneration across Shopify, WP & Webflow
- Priority onboarding & custom webhook notifications