From 9e93e375060be2bdac8e4ded52d5e501c529d413 Mon Sep 17 00:00:00 2001 From: Florian Date: Fri, 1 May 2026 07:31:13 -0500 Subject: [PATCH] [DOCS] Restore dev-version banner gate after VitePress migration (#2305) The VuePress->VitePress migration replaced the `themeConfig.mode === 'dev'` gate with a heuristic on `site.title`. CI overrides version with a short SHA (dev) or git tag (prod), so the title never contains "edge"/"dev" and the banner never renders on live deploys. Surface `meta.mode` in `themeConfig` and check it directly, mirroring the original behaviour. Co-authored-by: Claude Opus 4.7 (1M context) --- docs/.vitepress/config.mts | 6 ++++++ docs/index.md | 13 ++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 1ae0c68..6e498cb 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -32,6 +32,12 @@ export default defineConfig({ }, themeConfig: { siteTitle: 'OpenMQTTGateway', + // @ts-expect-error custom fields consumed by index.md to render the dev-version banner + mode: meta.mode, + // @ts-expect-error + version: meta.version, + // @ts-expect-error + repo: meta.theme_config_repo, nav: commonNav, socialLinks: [ { icon: 'github', link: `https://github.com/${meta.theme_config_repo}` } diff --git a/docs/index.md b/docs/index.md index fb0c33a..930a45b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,12 +1,19 @@

Development Version

-

This is the edge version of the documentation. It is under active development and may contain bugs, incomplete features, or breaking changes. Use it at your own risk.

+

This is the edge version of the documentation, built from commit {{ version }}{{ version }}. It is under active development and may contain bugs, incomplete features, or breaking changes. Use it at your own risk.

OpenMQTTGateway aims to unify various technologies and protocols into a single firmware. This reduces the need for multiple physical bridges and streamlines diverse technologies under the widely-used [MQTT](http://mqtt.org/) protocol.