---
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-05-06T18:44:35.586Z"
---

## `'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`.

```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:**

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        route
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Page route (e.g., <code>
        /about
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        markdown
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Generated markdown (modify this)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        title
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Page title
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        description
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Page description
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        headings
      </code>
    </td>
    
    <td>
      <code className="language-ts shiki shiki-themes github-light github-light material-theme-palenight" language="ts" style="">
        <span class="sqjlB">
          Array
        </span>
        
        <span class="sc1V3">
          <
        </span>
        
        <span class="sqjlB">
          Record
        </span>
        
        <span class="sc1V3">
          <
        </span>
        
        <span class="sqjlB">
          string
        </span>
        
        <span class="sx-uw">
          ,
        </span>
        
        <span class="sqjlB">
          string
        </span>
        
        <span class="sc1V3">
          >>
        </span>
      </code>
    </td>
    
    <td>
      Extracted headings from page
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        updatedAt
      </code>
    </td>
    
    <td>
      <code>
        string?
      </code>
    </td>
    
    <td>
      Last modified date (from sitemap)
    </td>
  </tr>
</tbody>
</table>

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.

```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:**

<table>
<thead>
  <tr>
    <th>
      Property
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        sections
      </code>
    </td>
    
    <td>
      <code>
        LlmsTxtSection[]
      </code>
    </td>
    
    <td>
      Sections with title, description, links
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        notes
      </code>
    </td>
    
    <td>
      <code>
        string[]
      </code>
    </td>
    
    <td>
      Notes at end of file
    </td>
  </tr>
</tbody>
</table>

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