Nuxt AI Ready generates /llms.txt and /llms-full.txt during prerender following the llms.txt standard.
/llms.txtSite overview with page links. Built from page metadata collected during prerender.
Live example: nuxtseo.com/llms.txt
# <Site Title>
> <Site Description>
## Pages
- [Page Title](/page-link): Meta Description
...
## <Section Title>
- [Link Title](/link): Description
...
<Notes>
Add custom sections:
export default defineNuxtConfig({
aiReady: {
llmsTxt: {
sections: [
{
title: 'API Reference',
links: [
{ title: 'REST API', href: '/docs/api', description: 'API documentation' }
]
}
],
notes: 'Built with Nuxt AI Ready'
}
}
})
Full config: Configuration
Modify sections before generation:
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.txtFull markdown content for all pages. Streamed during prerender — each page appended as processed, no memory accumulation.
Auto-generated from prerendered pages. Hook ai-ready:page:markdown fires per page if you need to modify content:
export default defineNuxtConfig({
hooks: {
'ai-ready:page:markdown': (ctx) => {
// ctx: { route, markdown, title, description }
ctx.markdown = `# ${ctx.title}\n\n${ctx.markdown}`
}
}
})
Page discovery uses a two-phase approach combining prerendering and sitemap crawling.
During nuxi generate, the module intercepts each prerendered page:
.md route for each rendered pageai-ready:page:markdown hook fires for each pagepage-data.jsonl + streamed to llms-full.txtPrerendered pages have full metadata (title, description, headings).
After prerendering completes, the module crawls /sitemap.xml for any pages not already processed:
sitemap:prerender:done hook when @nuxtjs/sitemap is installedprerender:done hook otherwise.md for each sitemap URL not in prerender setpage-data.jsonl but skips llms-full.txt (prevents duplicates)This catches SSR-only pages that weren't prerendered.
In SSR-only mode (no prerendering), llms.txt dynamically fetches /sitemap.xml and lists URLs without titles.
Phase 1 (Prerender) Phase 2 (Sitemap) Runtime
───────────────────── ───────────────────── ─────────────────────
app:rendered sitemap:prerender:done GET /llms.txt
↓ ↓ ↓
Queue .md routes Parse sitemap.xml fetchSitemapUrls()
↓ ↓ ↓
HTML → Markdown Fetch .md for SSR Combine prerendered
↓ pages + sitemap URLs
Write JSONL + ↓ ↓
llms-full.txt Add to JSONL only Generate llms.txt
Use the ai-ready:page:markdown hook to modify or filter pages during prerender:
export default defineNuxtConfig({
hooks: {
'ai-ready:page:markdown': (ctx) => {
// Skip draft pages
if (ctx.route.startsWith('/drafts/')) {
ctx.markdown = '' // Empty markdown = excluded from llms-full.txt
return
}
// Add frontmatter
ctx.markdown = `---
route: ${ctx.route}
title: ${ctx.title}
---
${ctx.markdown}`
}
}
})
Context properties:
route: Page path (e.g., /about)markdown: Converted content (mutable)title: Extracted <title>description: Extracted meta descriptionheadings: Array of { level, text } objectsUse the ai-ready:mdreamConfig Nitro hook to customize HTML → markdown:
export default defineNitroPlugin((nitroApp) => {
nitroApp.hooks.hook('ai-ready:mdreamConfig', (config) => {
// Skip navigation elements
config.ignoreSelectors = ['nav', '.sidebar', '.footer']
// Preserve code blocks
config.preserveCodeBlocks = true
})
})
Use the ai-ready:markdown Nitro hook for runtime .md requests:
export default defineNitroPlugin((nitroApp) => {
nitroApp.hooks.hook('ai-ready:markdown', (ctx) => {
// Add source link
ctx.markdown += `\n\n---\nSource: ${ctx.route}`
})
})
The module requires @nuxtjs/sitemap for page discovery:
export default defineNuxtConfig({
modules: ['@nuxtjs/sitemap', 'nuxt-ai-ready']
})
If sitemap is missing or empty, llms.txt will have an empty pages section with a warning logged.
Pages excluded from sitemap are automatically excluded from llms.txt. Use sitemap's exclude option:
export default defineNuxtConfig({
sitemap: {
exclude: ['/admin/**', '/api/**', '/drafts/**']
}
})
In development, llms.txt returns a notice about missing data. Page data is only available after nuxi generate or nuxi build --prerender.
Runtime .md routes still work in dev for testing markdown conversion.