Skip to content
These are the docs for Clay 4.x. Go to the latest version (5.x)
On this page

Publishing

A Clay build is a folder of static files: there is no server to run, and any host that serves files can serve a Clay site.

#From your docs to the web

  1. Preview while you write with npx clay dev.
  2. Build and check with npx clay build --strict. Broken links and typos in the settings stop the build.
  3. Look at the result with npx clay preview, the way a web host serves it.
  4. Publish publish/public, best by a workflow on every push, see GitHub Pages or other hosts.

#Where to host

Host Cost Set up in
GitHub Pages Free for public repositories A workflow file, see the guide
Netlify, Cloudflare Pages Free plans The host’s build settings
GitLab Pages Free .gitlab-ci.yml
Your own server Your server nginx, Caddy or Docker

#Before you go live

Does the site live under a path?

A site at https://my-org.github.io/my-project/ needs baseURL: "/my-project/" in clay.yaml, or its styles and links break. Check with npx clay preview, which serves the site under its baseURL.

Do I want links and dates for search engines?

Set siteURL to the site’s origin, like https://my-org.github.io: pages then get canonical links, and the build writes a sitemap. See SEO.

Does CI fetch the full history?

Clay takes the last-updated date of each page from git. Most CI systems clone only the last commit; check out the full history to get the dates, see page details.

Tip

Run npx clay build --strict locally before you push. It takes a few seconds and catches the same problems CI would.