# How to add llms.txt, JSON-LD, and AI crawler controls to Nuxt - agentmarkup

> Use @agentmarkup/nuxt to generate llms.txt, inject JSON-LD, create markdown mirrors, and manage AI crawler rules from prerendered Nuxt output.

Source: https://agentmarkup.dev/blog/nuxt-llms-txt-json-ld/

By [Sebastian Cochinescu](/authors/sebastian-cochinescu/) · June 21, 2026 · 7 min read

# How to add llms.txt, JSON-LD, and AI crawler controls to Nuxt

Nuxt sites need the same machine-readable surface as any other modern website: `llms.txt`, structured data, markdown mirrors, crawler rules, and validation. The key is hooking into the build at the moment Nuxt has actually written your prerendered HTML to disk, so those artifacts reflect the final output.

## Where the Nuxt adapter runs

[@agentmarkup/nuxt](https://www.npmjs.com/package/@agentmarkup/nuxt) is a Nuxt module that runs after Nitro finishes prerendering. It hooks Nitro's `prerender:done` event and processes the emitted `.output/public` directory: the same final-output-first model the other agentmarkup adapters use.

That means it is strongest on the `nuxt generate` path and on any route you prerender with `routeRules` or `prerender: true`. Those are the routes that produce build-time HTML files for the module to read and augment.

## What the Nuxt adapter gives you

- **`llms.txt`** generation from your config, with the homepage discovery link injected automatically
- **Optional `llms-full.txt`** with inlined same-site markdown context when mirrors exist
- **JSON-LD injection** into emitted HTML plus validation of existing schema blocks
- **Optional markdown mirrors** for thin or noisy prerendered pages that need a cleaner fetch target for agents
- **`robots.txt` patching** for AI crawler directives like GPTBot, ClaudeBot, and Google-Extended
- **Header support** for Content-Signal and markdown canonicals through the static `_headers` output
- **Build-time validation** for schema mistakes, crawler conflicts, thin HTML, and markdown drift

## Basic setup

Install the module:

```
pnpm add -D @agentmarkup/nuxt
```

Then register it and pass the shared config under the `agentmarkup` key:

```
// nuxt.config.ts
export default defineNuxtConfig({
 modules: ['@agentmarkup/nuxt'],
 agentmarkup: {
 site: 'https://example.com',
 name: 'Example Docs',
 description: 'Technical docs and product pages.',
 globalSchemas: [
 { preset: 'webSite', name: 'Example Docs', url: 'https://example.com' },
 { preset: 'organization', name: 'Example Inc.', url: 'https://example.com' },
 ],
 llmsTxt: {
 sections: [
 {
 title: 'Documentation',
 entries: [
 {
 title: 'Getting Started',
 url: '/docs/getting-started',
 description: 'Setup guide and first steps',
 },
 ],
 },
 ],
 },
 llmsFullTxt: {
 enabled: true,
 },
 markdownPages: {
 enabled: true,
 },
 contentSignalHeaders: {
 enabled: true,
 },
 aiCrawlers: {
 GPTBot: 'allow',
 ClaudeBot: 'allow',
 PerplexityBot: 'allow',
 'Google-Extended': 'allow',
 CCBot: 'disallow',
 },
 },
})
```

The config shape is the same `AgentMarkupConfig` used by the Vite, Astro, and Next.js adapters. Only the integration point changes: Nuxt reads it from the `agentmarkup` key.

## Where it works best

Run a prerendered build and you get the full output flow written into `.output/public`:

```
.output/public/
 llms.txt
 llms-full.txt
 robots.txt
 _headers
 docs/getting-started/index.html
 docs/getting-started.md
```

Because the module reads the directory Nitro actually wrote, the artifacts reflect your real final HTML rather than an earlier build step.

## The one caveat that matters

Fully dynamic SSR routes are the boundary. If a route is rendered on demand by the Nitro server and never emits a build-time HTML file, there is no final file for the module to patch afterward.

That does **not** make the package useless for Nuxt apps. It just means you should be precise about ownership:

- **Use `@agentmarkup/nuxt`** for prerendered routes, `nuxt generate` output, generated root artifacts, and header output
- **Use the re-exported `@agentmarkup/core` helpers** inside app code (for example a server route or Nitro handler) for truly dynamic routes that have no build-time HTML file

## Should you enable markdown mirrors?

Only when they add signal. If your prerendered HTML is already substantial, keep HTML as the primary fetch target. If the built page is thin, noisy, or heavily shell-like, generated markdown mirrors can give fetch-based agents a cleaner path.

agentmarkup keeps that feature disciplined by generating mirrors from final HTML, keeping them directly fetchable, and adding canonical headers back to the HTML route so search engines keep the page itself as the preferred URL.

## The bottom line

If your Nuxt app prerenders its pages, [@agentmarkup/nuxt](https://www.npmjs.com/package/@agentmarkup/nuxt) is the natural module. It gives you build-time machine-readable output on the same config surface as the other adapters, without stitching the pieces together by hand.

Start with the module for the routes Nuxt prerenders, keep markdown mirrors optional, and use [@agentmarkup/core](https://www.npmjs.com/package/@agentmarkup/core) directly only where fully dynamic SSR makes that necessary.

If you need the underlying pieces in more detail, read the [llms.txt guide](/docs/llms-txt/), the [JSON-LD guide](/docs/json-ld/), and the [AI crawlers guide](/docs/ai-crawlers/).

## Make your website machine-readable

agentmarkup is an open-source build-time toolkit for Vite, Astro, Next.js, and Nuxt (plus a framework-agnostic CLI) that generates llms.txt, injects JSON-LD structured data, creates optional markdown mirrors from final HTML when raw pages need a cleaner agent-facing fetch path, manages AI crawler robots.txt rules, patches optional Content-Signal and canonical mirror headers, and validates everything at build time. Zero runtime cost.

 Learn more GitHub
```
pnpm add -D @agentmarkup/vite # or @agentmarkup/astro, @agentmarkup/next, @agentmarkup/nuxt, @agentmarkup/cli
```

Written by

[Sebastian Cochinescu](/authors/sebastian-cochinescu/) · Developer of agentmarkup

Builder of developer tools for machine-readable websites. Developer of agentmarkup. Founder of Anima Felix.

## More from the blog

### Run agentmarkup on any static site with the CLI

Use @agentmarkup/cli to run llms.txt, JSON-LD, markdown mirrors, and AI crawler controls over any built static output, with a CI check command.

 June 21, 2026 · 6 min read

### How to add llms.txt, JSON-LD, and AI crawler controls to Next.js

Use @agentmarkup/next to generate llms.txt, inject JSON-LD, manage AI crawler rules, and understand the dynamic SSR boundary in Next.js.

 March 23, 2026 · 8 min read

### When markdown mirrors help, and when they do not

A practical guide to when generated markdown mirrors add signal, when HTML is already enough, and how to avoid unnecessary downsides.

 March 20, 2026 · 7 min read

### Is your website ready for AI? Free LLM discoverability checker

Audit your website for llms.txt, JSON-LD, robots.txt, markdown mirrors, and sitemap. Free tool for e-commerce and brand websites.

 March 20, 2026 · 8 min read

### Build-time markdown mirrors for agent readability: Cloudflare comparison

Build-time markdown generation for AI readability, including when it helps and how it compares to Cloudflare runtime extraction.

 March 20, 2026 · 7 min read

### How to make your brand appear in AI conversations

Organization schema, llms.txt, and FAQ markup make your brand visible in ChatGPT, Claude, and Perplexity answers.

 March 20, 2026 · 7 min read

### Why LLM-optimized e-commerce websites sell more

Product JSON-LD, llms.txt, and AI crawler access make your store visible in AI product recommendations.

 March 20, 2026 · 8 min read

### Every AI crawler indexing your website in 2026

Complete list: GPTBot, ClaudeBot, PerplexityBot, Google-Extended, CCBot, and more. What each does and how to control access.

 March 20, 2026 · 8 min read

### JSON-LD structured data: the complete guide for web developers

Schema types, JSON-LD vs microdata, common mistakes, and build-time validation.

 March 20, 2026 · 10 min read

### What is GEO? Generative Engine Optimization explained for developers

What is real, what is hype, and what you can do today to make your site citeable by AI.

 March 20, 2026 · 7 min read

### Why llms.txt matters: making your website discoverable by AI

LLMs answer questions by synthesizing web content. llms.txt gives them a structured overview of your site.

 March 20, 2026 · 6 min read
