LLMs Integration
TockDocs integrates nuxt-llms by default to prepare your content for Large Language Models (LLMs). All your documentation pages are injected and /llms.txt and /llms-full.txt files are automatically generated and pre-rendered.
/llms.txt file on a deployed TockDocs site.Defaults
Here are the default values use to generate the /llms.txt file:
domain→ computed based on your deployment platform (or by usingNUXT_SITE_URLenv variable)title→ extracted from yourpackage.jsondescription→ extracted from yourpackage.jsonfull.title→ extracted from yourpackage.jsonfull.description→ extracted from yourpackage.json
Customize
You can override your LLMs data from the nuxt.config.ts :
export default defineNuxtConfig({
llms: {
domain: 'https://your-site.com',
title: 'Your Site Name',
description: 'A brief description of your site',
full: {
title: 'Your Site Name',
description: 'A brief description of your site',
},
},
})
Raw Markdown Access
When nuxt-llms is enabled, TockDocs exposes the original source markdown/MDC through canonical .md page URLs, so AI tools can avoid the verbose post-processed output.
How it works
- Direct page alias: append
.mdto supported documentation page URLs to open the original pre-processed markdown/MDC source, for example/docs/manual/en/ai/llms.mdor/en/getting-started/installation.md - Canonical markdown URL: append
.mdto a page route to get the original markdown/MDC source - Compatibility aliases:
/source/<page-route>.mdand/raw/<content-path>.mdstill resolve to the same original source markdown for older integrations - Content-Type:
text/markdown; charset=utf-8 - LLMs.txt integration: document links in
llms.txtare automatically rewritten to.mdpage URLs, so agents fetch the original markdown/MDC instead of full HTML
- Direct URL alias:
/docs/manual/en/ai/llms.md - Compatibility source alias:
/source/docs/manual/en/ai/llms.md - Compatibility raw alias:
/raw/docs/manual/en/ai/llms.md
Configuration
You can customize the legacy nuxt-llms raw endpoint from your nuxt.config.ts:
export default defineNuxtConfig({
llms: {
contentRawMarkdown: {
// Prevent specific page collections from being exposed
excludeCollections: ['landing', 'landing_en', 'landing_fr'],
// Keep llms.txt links pointing to rendered pages instead of raw markdown
rewriteLLMSTxt: false,
},
},
})
To disable the legacy raw endpoint entirely:
export default defineNuxtConfig({
llms: {
contentRawMarkdown: false,
},
})
Markdown Redirection
.md page URLs work in every environment. On server-backed deployments, TockDocs also negotiates markdown responses from standard page URLs when agents send markdown-friendly headers. On Vercel, build-time route rules keep prerendered pages behaving the same way.On server-backed deployments, TockDocs automatically serves markdown content to AI agents and CLI tools when requests prefer markdown responses.
Why?
Agents like Claude Code use Accept: text/markdown headers by default, so returning source Markdown saves lots of data transfer and tokens in the process.
How?
TockDocs detects requests from AI agents and command-line tools using HTTP headers:
- Accept header: Requests with
Accept: text/markdownreceive the markdown version of the page - User-agent detection:
curlrequests are treated like agent-style markdown fetches
Negotiation Rules
- Root path:
/→/llms.txt - Documentation pages:
/{path}→/{path}.md
Example Usage
# Open the source markdown directly with the page URL
curl https://your-site.com/docs/manual/en/ai/llms.md
# Get llms.txt from homepage
curl -H "Accept: text/markdown" https://your-site.com/
# Get llms.txt from a locale homepage (legacy i18n mode)
curl -H "Accept: text/markdown" https://your-site.com/en
# Get source markdown for a documentation page
curl -H "Accept: text/markdown" https://your-site.com/docs/manual/en/ai/llms
All these commands will return markdown content instead of HTML.