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.
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. This section is only about the automatic header-based markdown redirects that TockDocs adds on Vercel.When deployed on Vercel, TockDocs automatically configures intelligent routing to serve markdown content to AI agents and CLI tools.
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/markdownare automatically redirected - User-agent detection:
curlrequests as agents are automatically redirected
Redirect Rules
- Root path:
/→/llms.txt - Documentation pages:
/{path}→/{path}.md
Example Usage
# Open the source markdown directly with the page URL
curl https://tockdocs.dev/docs/manual/en/ai/llms.md
# Get llms.txt from homepage
curl -H "Accept: text/markdown" https://tockdocs.dev/
# Get llms.txt from locale homepage
curl -H "Accept: text/markdown" https://tockdocs.dev/en
# Get source markdown for a documentation page
curl -H "Accept: text/markdown" https://tockdocs.dev/docs/manual/en/ai/llms
All these commands will return markdown content instead of HTML.