Generate the llms.txt file for a site
seo-in-astro can generate the llms.txt file for your Astro site with automatic route detection.
Enabling llms.txt generation
Section titled “Enabling llms.txt generation”-
Set to
truethellmsTxtoption in the integration configuration.astro.config.mjs import { defineConfig } from "astro/config";import { seoInAstro } from "@dlcastillop/seo-in-astro";export default defineConfig({integrations: [seoInAstro({baseUrl: "https://example.com",siteName: "Example",defaultOgImg: "/default-og.png",llmsTxt: true,}),],}); -
Run a build for your Astro project.
Terminal window npm run buildTerminal window yarn buildTerminal window pnpm build -
Start the preview server.
Terminal window npm run previewTerminal window yarn previewTerminal window pnpm preview -
Open http://localhost:4321/llms.txt in your browser to see the generated file.