---
title: "Nuxt Hooks"
description: "Nuxt hooks provided by nuxt-ai-ready for extending functionality."
canonical_url: "https://nuxtseo.com/docs/ai-ready/api/nuxt-hooks"
last_updated: "2026-09-05T15:40:05.903Z"
---

## `'ai-ready:page:markdown'`{lang="ts"}

**Type:** `(ctx: ParsedMarkdownResult & { route: string }) => void | Promise<void>`{lang="ts"}

Called per page during prerender. Modify markdown content before it's written to `llms-full.txt` and `page-data.jsonl`.

```ts [nuxt.config.ts]
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>>`{lang="ts"} | Extracted headings from page      |
| `updatedAt`   | `string?`                                  | Last modified date (from sitemap) |

Only fires during `nuxi generate`{lang="bash"} or `nuxi build --prerender`{lang="bash"}.

## `'ai-ready:llms-txt'`{lang="ts"}

**Type:** `(payload: { sections: LlmsTxtSection[], notes: string[] }) => void | Promise<void>`{lang="ts"}

Called before llms.txt generation. Add or modify sections and notes.

```ts [nuxt.config.ts]
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[]`         | Heading-free context rendered before file-list sections |

Mutable pattern - modify arrays directly, don't return values.