Multi-Format Output

Cook can produce multiple output formats from your pages: markdown copies for content APIs, JSON metadata for programmatic access, an Atom feed for RSS readers, and llms.txt files for AI systems.

Markdown copies

When enabled, Cook copies the original .md source file to dist/md/{path}/index.md for every markdown-sourced page. This lets clients request raw markdown via content negotiation or direct URL.

For example, src/docs/quick-start.md produces both dist/docs/quick-start/index.html and dist/md/docs/quick-start/index.md.

JSON metadata

For every page, Cook generates a JSON file at dist/api/{path}.json containing extracted metadata:

Collection items include additional fields like date, author, and tags when present in frontmatter.

Atom feed

Generate an Atom feed from any collection by configuring the feed option:

This produces dist/feed.xml with the most recent items from the specified collection, sorted by date.

llms.txt

The llms.txt file is an index of all markdown content on your site, designed for AI agents and LLM tools. It lists every page with its title, description, and a link to the markdown version.

Pages with a section frontmatter field are grouped under section headings. Pages without a section appear under a generic "Content" heading.

AI instructions

Add custom instructions for AI agents via data.llmsInstructions in your data file:

The instructions appear in llms.txt under an "Instructions for AI Agents" heading.

llms-full.txt

When enabled, Cook concatenates all markdown page content (with frontmatter stripped) into a single dist/llms-full.txt file. This is ideal for bulk ingestion by IDE tools and AI systems that want the entire site in one request.

SocialSpec files

Cook can also write following.opml, about.md and contact.vcf under /.well-known/ from config/social.json. The Worker returns these untouched, never rewriting them to /md/. See the SocialSpec docs.

Configuration

OptionDefaultDescription
markdowntrueCopy markdown sources to dist/md/
jsontrueGenerate JSON metadata in dist/api/
feednullAtom feed config ({ collection, title, siteUrl, limit })
llmsTxttrueGenerate dist/llms.txt
llmsFullTxtfalseGenerate dist/llms-full.txt