On this page
Migrating from Clay 1
Clay 1 needed two parts: the Clay frontend and Clay Oven, a separate Go tool that prepared the docs. Clay 2 is a single npm package, clay-doc, that does both. Your docs and clay.yaml keep working; what changes is how you build. This page covers the step to Clay 2; continue with upgrading to Clay 3 afterwards.
#What stays the same
- The
docs/folder, Markdown files and their front matter. clay.yamlanddir-meta.yaml, with all their settings (Clay 3 then movesdir-meta.yamlintoindex.mdfiles).- The environment variables
CLAY_TITLE,CLAY_BASE_URL,CLAY_SITE_URLandCLAY_FONTAWESOME_KIT. - The URLs of your pages.
#What changes
| Clay 1 | Clay 2 |
|---|---|
Download Clay Oven, run ./clay-oven |
npm install --save-dev clay-doc, run npx clay build |
Output in output/ |
Output in publish/public |
run-oven.sh in CI |
npm ci and npx clay build --strict |
-c, -d, -o, -fm flags |
--root and --out; the file names are fixed |
-nc, -ci to skip prompts |
No prompts anymore |
langs in clay.yaml |
Not needed: languages of code blocks are detected |
| No live preview | npx clay dev |
#Step by step
#1. Install Clay
#2. Clean up clay.yaml
Remove langs, if you have it. Clay 2 warns about it but works anyway.
#3. Update .gitignore
node_modules/
publish/
output/#4. Build and check
Clay 2 checks links and settings more thoroughly than Clay Oven did. Fix what it reports; see build checks.
#5. Update CI
Replace the Clay Oven step in your workflow:
- name: Build docs
run: curl -fsSL https://raw.githubusercontent.com/clay-doc/clay-oven/refs/heads/main/run-oven.sh | sh
- uses: actions/setup-node@v7
with:
node-version: lts/*
cache: npm
- run: npm ci
- run: npx clay build --strictand upload publish/public instead of output. GitHub Pages has a complete workflow.
#New in Clay 2
Once migrated, these are available without further work:
- a live preview with
clay dev, - build checks for links and settings,
- search with typo tolerance, and SEO with a sitemap,
descriptionandorderin the front matter,- clay edit, versions and translations.