CmdocsCmdocs
Content

Static Files

Serve images, logos, fonts, and downloads from the public/ folder.

Static Files

Anything you drop into the public/ folder is copied to the root of your built site. Use it for images, logos, favicons, fonts, OpenGraph cards, PDFs, and any other static asset your docs need to reference.

How it works

At build time, cmdocs walks your public/ directory and copies every file into the static output. Reference any file with an absolute path starting with / — that path resolves to the same file in dev and in production.

Project layout

docs.json
index.mdx
og-image.png
light.svg
dark.svg
architecture.png
hero.jpg
inter.woff2
brand-kit.zip

Always reference assets with an absolute path (/og-image.png), not a relative one (./public/og-image.png). The public/ prefix is dropped at build time.

Adding an image

Drop the file into public/

Place your image anywhere under public/. Sub-folders are preserved:

cp ~/Downloads/diagram.png my-docs/public/images/diagram.png

Reference it with an absolute path

Use either Markdown or an <img> tag — both work, and both get automatic zoom on click:

![Architecture diagram](/images/diagram.png)

Save and reload

The dev server picks it up immediately. In production, the file is served from the root of your site.

Reference styles

![cmdocs OG image](/og-image.png)

cmdocs OG image

<img src="/og-image.png" alt="cmdocs OG image" />
cmdocs OG image
<img
  src="/logo/light.svg"
  alt="cmdocs logo"
  width="160"
  height="40"
/>
cmdocs logo

All images — Markdown or <img> — are wrapped in a zoomable viewer. Click any image to expand it.

Prop

Type

Common locations

AssetConventional pathReferenced from
Favicon/public/logo/light-logo-only.svgdocs.jsonfavicon
Navbar logo (light)/public/logo/light.svgdocs.jsonnavbar.logo.light
Navbar logo (dark)/public/logo/dark.svgdocs.jsonnavbar.logo.dark
OpenGraph image/public/og-image.pngdocs.jsonseo.ogImage
Page images/public/images/*MDX pages

FAQ

What's next

How is this guide?

On this page