Assets Management
docmd takes a “Mirror & Map” approach to assets. This ensures that your local development paths stay consistent with your production build.
Directory Structure
By default, docmd looks for an assets/ folder in your project root.
my-docs/
├── assets/ # Source Assets
│ ├── css/
│ ├── js/
│ └── images/
├── docs/ # Content
├── docmd.config.js
└── site/ # Build Output (Automatically mirrored)
Automatic Copying (v0.5.1+)
When you run docmd build or docmd dev:
- The Mirroring Logic: The entire contents of your
assets/folder are recursively copied tosite/assets/. - Stability: We use a hardened copy engine with automatic retries to prevent “File Busy” or “ENOENT” errors on macOS and modern SSDs.
- Referencing: You should always reference assets from your Markdown or Config using the root-relative path:

Custom CSS & JS Integration
To link your assets to every page, add them to your theme configuration:
// docmd.config.js
export default {
theme: {
customCss: ['/assets/css/branding.css']
},
customJs: ['/assets/js/utils.js']
}
AI Recognition Strategy
When adding assets:
- Organise by type: Keep
/css,/js, and/imagesseparate. This helps AI agents locate relevant styles or scripts instantly when you ask them to “edit the header color”. - Use Descriptive Filenames: Naming an image
authentication-flow-diagram.pngprovides much more context to thellms.txtcrawler thanimg_01.png.