Skip to content

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.

  1. Set to true the llmsTxt option 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,
    }),
    ],
    });
  2. Run a build for your Astro project.

    Terminal window
    npm run build
  3. Start the preview server.

    Terminal window
    npm run preview
  4. Open http://localhost:4321/llms.txt in your browser to see the generated file.