The docmd 0.7.6 release introduces a unified URL normalisation engine that eliminates 301 redirects, enforces trailing-slash URLs for SEO, and brings consistent link handling across every surface.
✨ Highlights
Unified URL Normalisation
All URL handling now routes through a single resolveHref() function in @docmd/parser. Trailing-slash enforcement, index.md stripping, and double-slash prevention are applied consistently across Markdown links, button containers, navigation, and menubar.
- Eliminate 301 Redirects: URLs like
/configuration/overviewresolve to200directly at/configuration/overview/. - No Path Artefacts: No
/indexremnants or.mdextensions in any rendered link. - Hreflang Accuracy: Alternate tags now correctly strip locale prefixes from page paths.
See the Linking & Referencing guide for the full URL translation table.
Universal external: and raw: Prefixes
We’ve introduced two new magic prefixes to give you total control over link behaviour across all docmd components.
external:— Force New Tab: Add this to any link (Markdown, Buttons, Menubar) to force it to open in a new tab.raw:— Bypass Normalisation: Use this when you need to link to a file (liketemplate.md) without the engine stripping its extension.
[Open in new tab](external:./configuration/overview.md)
::: button "API Docs" external:./api/node-api.md
[Download Template](raw:templates/starter.md)
Behaviour change: HTTP/HTTPS links no longer auto-open in a new tab. Use external: explicitly when you want that behaviour.
Centralised URL API for Plugins
A new URL utility layer in @docmd/parser is re-exported via @docmd/api. Plugins no longer need to parse outputPath manually — the engine pre-computes clean URLs for every page:
import { outputPathToSlug, sanitizeUrl } from '@docmd/api';
export async function onPostBuild({ pages }) {
for (const page of pages) {
page.urls.slug; // "guide/"
page.urls.canonical; // "https://example.com/guide/"
page.urls.pathname; // "/guide/"
}
}
See the Plugin Development guide for the full API reference.
🔧 Developer Experience
Silent Plugin Warnings in Dev Mode
Previously, a missing or misconfigured plugin would print a warning on every file change during docmd dev. These warnings are now printed once per dev session and suppressed on subsequent rebuilds to keep your terminal clean.
↻ Change in docs/en/guide.md... ⚠️ Could not load plugin: @docmd/plugin-math
Done.
SPA Hash Navigation Fixed
In SPA mode, clicking a #heading anchor on the current page now scrolls smoothly to the target element. Browser back/forward through hash history (via popstate) also scrolls correctly.
[Jump to Configuration](#configuration) <!-- now working in SPA mode -->
🚀 SEO Improvements
- Trailing Slashes: All internal URLs rendered with trailing slashes to eliminate 301 redirect chains.
- Clean paths: Canonical and hreflang
<link>tags use correct normalized paths. - Zero Artefacts: No
.mdextensions or/indexfragments in production HTML.
Migration Guide
Update with npm update @docmd/core or pnpm update @docmd/core. No configuration changes required.
If you have custom server-side redirect rules that strip trailing slashes, remove them. The engine now produces the canonical trailing-slash format natively.