Index of every page on this site: llms.txt

Nuxt AI Ready publishes /llms.txt as a page index and /llms-full.txt as a full-content export. Prerendering writes static files. On a server, the runtime handlers use stored pages and sitemap data. The llms.txt proposal defines the index format, but does not define the full-content export.

/llms.txt

Use this file to give agents a site overview and links to relevant pages. The current sitemap controls which pages appear. Stored pages supply titles and descriptions. Files longer than 80,000 characters become linked files under /llms/. The module serves GET and HEAD for every generated file.

Live example: nuxtseo.com/llms.txt

# <Site Title>

> <Site Description>

Canonical Origin: https://example.com

**Notes:**

<Notes>

## <Section Title>

- [Link Title](/link): Description
  ...

## Pages

- [Page Title](https://example.com/page-link.md): Meta Description
  ...

Configuration

Add custom sections:

nuxt.config.ts
export default defineNuxtConfig({
  aiReady: {
    llmsTxt: {
      markdownLinks: true,
      sections: [
        {
          title: 'API Reference',
          links: [
            { title: 'REST API', href: '/docs/api', description: 'API documentation' }
          ]
        }
      ],
      notes: 'Built with Nuxt AI Ready'
    }
  }
})

Full config: Configuration

Link descriptions appear after each link on the same line. Section descriptions and notes appear before the first H2. Sections marked optional share one ## Optional list. Their descriptions become part of each link note.

Page links point to each page's Markdown representation by default: a static .md file, or an eligible runtime Markdown route. File-like, internal, ignored, or skipped routes keep their canonical URLs. Set markdownLinks: false to link every page to its canonical URL.

Directive

Every page's .md response starts with a line that points at llms.txt, right after the frontmatter:

> Index of every page on this site: [llms.txt](https://example.com/llms.txt)

An agent that lands on one page then knows where to find the rest of the site. llms-full.txt and /sitemap.md do not repeat the line. Set directive.html: true to also add a visually hidden link to /llms.txt at the top of every HTML page's body. Set directive.markdown: false to remove the Markdown line.

nuxt.config.ts
export default defineNuxtConfig({
  aiReady: {
    llmsTxt: {
      directive: { markdown: true, html: true },
    },
  },
})

With a site.url, page links are absolute URLs on that origin. An agent that fetches llms.txt on its own has no base URL to resolve a root-relative link against. Without a site URL, page links stay root-relative.

Large Sites and Named Sitemaps

Select current sitemaps and give large lists their own files:

nuxt.config.ts
export default defineNuxtConfig({
  aiReady: {
    llmsFullTxt: false,
    llmsTxt: {
      markdownLinks: true,
      sitemaps: ['pages', 'skills', 'demos'],
      sections: [
        { title: 'Skills', sitemap: 'skills', path: '/llms/skills.txt' },
        { title: 'Demos', sitemap: 'demos', path: '/llms/demos.txt' }
      ]
    }
  }
})

The root lists the pages sitemap and links to the Skills and Demos files. The module reads chunked sitemaps with their configured names. An omitted sitemap, such as retired, supplies neither page links nor metadata. If a page appears in several sections, the first section owns its link. Empty sections produce no file or discovery link.

Each file stays within maxLength, which defaults to 80,000 characters. Large sections split again. Index files link every part, so no pages disappear at the limit. Paths beginning with /llms/_ belong to generated parts. Prerendering writes the complete file tree and Markdown for eligible sitemap pages in static builds.

Use pages: false to omit the automatic page list while retaining configured sections. Use pages: 'all' to include stored pages outside the selected sitemap. Use sitemaps: [] to stop sitemap discovery. These settings control discovery, so application access controls still protect private content.

Manual Files

Place a curated file at public/llms.txt. The module detects it, preserves its contents, and leaves its route to Nuxt. Markdown conversion and discovery headers continue to work.

If your application supplies a server route, disable generation explicitly:

nuxt.config.ts
export default defineNuxtConfig({
  aiReady: {
    llmsTxt: false,
    llmsFullTxt: false
  }
})

The application then owns /llms.txt and any nested files. Use llmsFullTxt: false to omit the full export, its route, and its generated discovery link. Remove any application redirect from /llms-full.txt to /llms.txt. Such a redirect prevents agents from receiving the advertised full export.

Hook

Modify sections before generation:

nuxt.config.ts
export default defineNuxtConfig({
  hooks: {
    'ai-ready:llms-txt': (payload) => {
      payload.sections.push({
        title: 'Custom APIs',
        links: [{ title: 'Search', href: '/api/search', description: 'Search endpoint' }]
      })
      payload.notes.push('Custom note')
    }
  }
})

Hook details: Nuxt Hooks

/llms-full.txt

During prerendering, the module appends each processed page to this export. At runtime, the server streams pages from the database. An empty database produces a setup notice.

llms-full.txt is not part of the llms.txt proposal. Nuxt AI Ready uses a thematic break and a compact metadata list to identify each source page, then preserves that page's original Markdown headings and fenced content:

llms-full.txt
# Example Site

> Example description.

Canonical Origin: https://example.com

---

- **Page:** Installation
- **Source:** https://example.com/installation
- **Description:** Install the package.

# Installation

## Requirements

Each page keeps its own headings. The export can therefore contain several H1 headings.

Use the Nuxt ai-ready:page:markdown hook to append information during prerendering:

nuxt.config.ts
export default defineNuxtConfig({
  hooks: {
    'ai-ready:page:markdown': (ctx) => {
      ctx.markdown += `\n\nSource route: ${ctx.route}`
    }
  }
})

Page Discovery

Prerendering collects rendered pages first. A sitemap crawl can add routes that were not prerendered.

Phase 1: Prerender Crawl

During nuxi generate, the module intercepts each prerendered page:

  1. The module queues a Markdown route for each eligible rendered page.
  2. The middleware reads content source or converts rendered HTML. HTML conversion runs the Nitro conversion hooks.
  3. The Nuxt ai-ready:page:markdown hook runs.
  4. Page data enters SQLite and content is appended to llms-full.txt.

Prerendered pages have full metadata (title, description, headings).

Phase 2: Sitemap Crawl

After prerendering completes, the module crawls /sitemap.xml for any pages not already processed:

  • Uses sitemap:prerender:done when the sitemap is prerendered.
  • Otherwise, fetches the sitemap during prerender:done.
  • Requests Markdown for eligible sitemap routes not already processed.
  • Stores those pages in SQLite without adding them to the static llms-full.txt.

This catches SSR-only pages that weren't prerendered.

Runtime Fallback

The runtime handler reads selected sitemap URLs and joins their stored page metadata. Stored rows outside the sitemap stay out of the default index. Stored pages provide titles and descriptions. Sitemap-only entries provide routes until indexing adds their metadata. If the database is unavailable, llms.txt falls back to sitemap URLs and logs the failure.

Configure runtime indexing to populate stored content on a server. Page visits alone do not populate the index.

Customizing Page Processing

Filter or Modify Pages

Use the Nuxt hook to omit a page's content from the static full export:

nuxt.config.ts
export default defineNuxtConfig({
  hooks: {
    'ai-ready:page:markdown': (ctx) => {
      if (ctx.route.startsWith('/drafts/'))
        ctx.markdown = ''
    },
  },
})

An empty body skips the page in the static llms-full.txt export. Its stored page record remains. This hook does not make a page private or remove its URL from llms.txt.

Context properties:

  • route: Page path (e.g., /about)
  • markdown: Converted content (mutable)
  • title: Extracted <title>
  • description: Extracted meta description
  • headings: Extracted heading records, such as { h2: 'Installation' }

Modify Markdown Conversion

These Nitro conversion hooks run whenever the module converts rendered HTML: runtime .md requests, prerendering, and page indexing. Prerendered .md files, llms-full.txt, and stored pages include their changes. ctx.isPrerender is true only during prerendering. They do not run for content-source responses. During prerendering, the Nitro ai-ready:page:markdown hook runs first, then the Nuxt hook of the same name.

Use the ai-ready:mdreamConfig Nitro hook to customize HTML → markdown:

server/plugins/mdream.ts
export default defineNitroPlugin((nitroApp) => {
  nitroApp.hooks.hook('ai-ready:mdreamConfig', (config) => {
    config.filter = {
      ...config.filter,
      exclude: [...(config.filter?.exclude || []), '.sidebar', '.footer'],
    }
  })
})

Post-Process Markdown at Runtime

Use the ai-ready:page:markdown Nitro hook for runtime .md requests:

server/plugins/markdown.ts
export default defineNitroPlugin((nitroApp) => {
  nitroApp.hooks.hook('ai-ready:page:markdown', (ctx) => {
    ctx.markdown += `\n\n---\nSource: ${ctx.route}`
  })
})

Sitemap Requirements

Nuxt AI Ready installs @nuxtjs/sitemap as a module dependency. Keep your sitemap current so discovery can find routes that are not already stored.

Use the sitemap exclude option to remove URLs from sitemap discovery:

nuxt.config.ts
export default defineNuxtConfig({
  sitemap: {
    exclude: ['/admin/**', '/api/**', '/drafts/**'],
  },
})

Excluding a URL removes it from the default llms.txt index, without deleting its stored record. The full export and other database consumers can still expose that record. Do not put private content in the public page index. Use application access controls for private routes.

Dev Mode

In development, llms.txt lists current sitemap URLs. Page paths stand in for titles until a production build or runtime indexing stores metadata. Runtime .md routes work in development, so you can inspect conversion before building.

Was this page helpful?