v0.5.0 marks a massive evolution for docmd. We are introducing Enterprise-Grade Versioning, a magical Zero-Config Mode, and a modernized configuration schema, all while maintaining our promise of zero bloat. This release transforms docmd from a simple documentation generator into a robust platform capable of handling complex, multi-versioned projects with ease.
✨ Highlights
1. Documentation Versioning Support
You asked, we delivered. You can now maintain multiple versions of your documentation (e.g., v1.0, v2.0) simultaneously. docmd handles the routing, asset separation, and UI automatically.
- Sticky Switching: Changing versions keeps you on the same page (e.g., switching v1 -> v2 while on
/installationtakes you to/v2/installation). - Smart Navigation: The sidebar automatically filters out links that don’t exist in older versions.
- Per-Version Navigation: You can completely override the menu for specific versions.
versions: {
current: 'v2', // Builds to root (/) for optimal SEO
all:[
{
id: 'v2',
dir: 'docs',
label: 'v2.x (Latest)'
},
{
id: 'v1',
dir: 'docs-v1',
label: 'v1.x',
// version specific navigation: not required (optional)
// docmd is smart enough to auto-generate custom nav for your specific version based on available docs
navigation: [
{ title: 'Legacy Guide', path: '/legacy-intro' }
]
}
]
}
2. Zero-Config Mode (--zero-config)
Want to document a project instantly? You no longer need a config file.
Run docmd dev -z for dev server and docmd build -z for production in any folder.
Our new Auto-Router will:
- Scan your directory structure recursively.
- Extract
H1titles from every Markdown file. - Build a deeply nested, collapsible sidebar.
- Launch the dev server instantly.
- Note: Zero-Config is still in
betaand does not support versioning yet.
3. V3 Configuration Schema (Simpler Labels)
We have streamlined the configuration labels to align with modern standards (like Vite/VitePress). It is cleaner, shorter, and more intuitive.
Legacy v0.4 labels are still 100% supported, so no breaking changes!
| Legacy | Modern (v0.5) | Description |
|---|---|---|
siteTitle |
title |
The name of your website. |
siteUrl |
url |
Production URL (Critical for SEO). |
srcDir |
src |
Your markdown source folder. |
outputDir |
out |
Build output folder. |
4. Native 404s & SEO Redirects
docmd now behaves like a mature Static Site Generator (SSG) regarding SEO traffic.
- Custom 404: We generate a native
404.htmlthat inherits your theme, sidebar, and layout. - Redirects: Define old paths in your config, and we generate static HTML redirects to preserve your SEO ranking.
module.exports = defineConfig({
redirects: { '/old-guide': '/new-guide' },
notFound: {
title: 'Page Not Found',
content: 'Oops! This page has moved.'
}
});
5. Whitelabeling (Hide Branding)
For professional use cases, you can now easily toggle off the “Built with docmd” footer signature.
footer: {
style: 'minimal',
branding: false // you can hide docmd signature now
}
📝 Complete Changelog
✨ Features & Enhancements
- Core: Implemented Multi-Version Build Engine. It loops through configured versions and builds them into isolated sub-directories (
/v1/,/v2/). - Core: Added Auto-Router for Zero-Config mode. It performs AST-free scanning of headers to build navigation trees dynamically.
- Core: Introduced
defineConfighelper for IDE autocomplete support. - Config: Added V3 Schema (
title,src,out,url) with internal normalization for backward compatibility. - UI: Added Version Dropdown component with “Sticky Path” logic (preserves relative path when switching versions).
- UI: Major sidebar CSS overhaul. The navigation list now scrolls independently of the header/footer (Flexbox layout), eliminating double scrollbars.
- UI: Sidebar dropdowns now intelligently open upwards when placed at the bottom of the sidebar.
- Dev Server: Now serves the custom
404.htmlinstead of a raw text error when a route is missing.
🐛 Bug Fixes
- Search: Fixed search index 404s in versioned subfolders by implementing
DOCMD_SITE_ROOTlogic. - Core: Fixed
ReferenceError: options is not definedin config loader when using specific flags. - UI: Fixed SPA Router duplicating relative paths (e.g.,
/v1/v1/page) by hard-reloading on version context switches. - Live Editor: Fixed crash caused by missing
isOfflineModeflag in the browser-side rendering engine. - Build: Fixed
EJS Render Errorfor 404 pages by passing correct template context. - Failsafe: Upgraded test suite to brute-test Versioning, Zero-Config, and Redirect generation before every release.
📥 Upgrade
npm install -g @docmd/core
Full Changelog: https://github.com/docmd-io/docmd/compare/0.4.11...0.5.0