Skip to content
On this page

Project Structure

A Clay project has a fixed layout. Clay looks for its files in the project folder: the folder you run clay in, or the one you pass with --root.

  • my-project
    • clay.yamlrequired: site settings
    • logo.svgoptional: logo and favicon, named in clay.yaml
    • docsrequired: the pages of the current version
      • index.mdoptional: the start page
      • introduction.md
      • introduction.de.mdoptional: a translation
      • guides
        • index.mdoptional: the folder's title, icon, order and page
        • setup.md
        • img
          • screen.pngimages and files are published as they are
    • package.jsonoptional: Clay as a dev dependency
    • publishcreated by clay build; do not commit

#What each part does

Path Purpose Read more
clay.yaml Title, base URL, navbar links, languages clay.yaml
docs/ Every .md file is a page; other files are published as they are pages
index.md The start page (docs/index.md), and a folder’s title, icon, order and page index pages
*.de.md and similar Translations of the page next to them translations
docs/latest/, docs/<name>/ With versions: the latest docs, and a saved copy for each older release versions
publish/public/ The finished website commands

#Rules for the docs folder

  • Every Markdown file becomes a page. Its path is its URL: docs/guides/setup.md is served at /guides/setup.
  • Folders become sections of the navigation. A folder only appears when it contains at least one page, at any depth.
  • Every other file, like images, PDFs or downloads, is copied into the site as it is, so pages can link to it.
  • Names starting with a dot (.DS_Store, .git) are ignored.

#What belongs in git

Commit clay.yaml, docs/, your logo, and package.json with its lockfile. Leave out the build output and the dependencies:

.gitignore
node_modules/
publish/

Tip

Clay shows when each page was last changed, taken from git. Keep the docs in a git repository, and check out the full history in CI, to get those dates. See page details.