✨ Highlights

A collection of improvements addressing navigation portability, preview environments, and offline usability. No breaking changes, no new config keys. Existing projects build and serve unchanged.

🌐 Contextual Page-Relative URL Resolution

To ensure complete portability of built sites, version, language, and project switchers now prioritize page-relative links (./, ../) rather than absolute base-path dependent ones.
This enables consistent navigation across different deployment contexts—such as local preview folders, subpath deployments (e.g. GitHub Pages), and root deployments—without requiring configuration changes.

🐛 Fix: Switcher Redirection Mismatch on Local Dev Server

In workspace configurations where the production deploy uses a custom base (e.g., /beta-test/i18n/), the dev server serves from /i18n/. Previously, client-side JS used the build-time base path (window.DOCMD_BASE) to route language and version changes, leading to broken redirects like localhost:3000/beta-test/i18n/de/.

The fix: the switchers in docmd-main.js now dynamically analyze the browser’s current window.location.pathname at runtime. If the workspace base prefix (e.g., /beta-test/) is absent from the current URL, it is automatically stripped from the routing calculation, ensuring seamless local development switching.

🔗 SPA Navigation Sync for Menubar & Banners

Previously, during SPA transitions, the top menubar (.docmd-menubar), announcement banner (.docmd-banner), and cookie consent banner (.docmd-cookie-banner) were not swapped in the DOM. On pages nested at different directory depths, this caused relative URLs inside these layout components to resolve incorrectly (e.g., resolving ../containers/ from a double-nested directory).

The fix: these outer layout components are now added to the SPA’s selectorsToSwap list. They are updated dynamically on every client-side page load, ensuring that relative navigation links and policy hrefs match the relative depth of the active page.

🔌 CLI --offline Mode

A new CLI --offline flag has been introduced for offline-only documentation viewing:

  • Bypasses Indexing: Stops keyword/semantic search indexing and prevents downloading semantic binaries to speed up the build process when offline.
  • In-Browser Suffixing: Enforces .html suffixes on all page-relative links to enable clean navigation under the file:// protocol.
  • Localized Offline Search Notice: Injects a localized message inside the search modal reminding the user that search is unavailable in offline builds.

🧹 Dependency Cleanup & Maintenance

  • Removed deprecated subdependencies (like boolean and node-domexception) from internal package trees.
  • Audited optional plugin footprints, confirming @docmd/plugin-math is optional for core and is only auto-installed/required when @docmd/live is active.

📦 Upgrade

upgrade
npx @docmd/core@0.8.17 build