'ai-ready:page:markdown'Type: (ctx: ParsedMarkdownResult & { route: string }) => void | Promise<void>
Called per page during prerender. Modify markdown content before it's written to llms-full.txt and page-data.jsonl.
export default defineNuxtConfig({
hooks: {
'ai-ready:page:markdown': (ctx) => {
// Add frontmatter
ctx.markdown = `---\ntitle: ${ctx.title}\n---\n\n${ctx.markdown}`
}
}
})
Context:
| Property | Type | Description |
|---|---|---|
route | string | Page route (e.g., /about) |
markdown | string | Generated markdown (modify this) |
title | string | Page title |
description | string | Page description |
headings | Array<Record<string, string>> | Extracted headings from page |
updatedAt | string? | Last modified date (from sitemap) |
Only fires during nuxi generate or nuxi build --prerender.
'ai-ready:llms-txt'Type: (payload: { sections: LlmsTxtSection[], notes: string[] }) => void | Promise<void>
Called before llms.txt generation. Add or modify sections and notes.
export default defineNuxtConfig({
hooks: {
'ai-ready:llms-txt': (payload) => {
payload.sections.push({
title: 'Custom APIs',
description: 'Additional endpoints',
links: [
{ title: 'Search', href: '/api/search', description: 'Search endpoint' }
]
})
payload.notes.push('Built with Nuxt AI Ready')
}
}
})
Payload:
| Property | Type | Description |
|---|---|---|
sections | LlmsTxtSection[] | Sections with title, description, links |
notes | string[] | Notes at end of file |
Mutable pattern — modify arrays directly, don't return values.