From 445bdaa82eb1e86dec9301ce0617ea58e734a2c8 Mon Sep 17 00:00:00 2001 From: mixedrays Date: Fri, 16 Oct 2026 20:25:40 +0200 Subject: [PATCH] docs: link the docs version to its manifest and show it in the footer The About page's docs version now links to apps/docs/package.json on GitHub, and the footer shows the docs version beside the package's, so a redeploy can be checked from any page. --- apps/docs/build/meta.ts | 11 ++++++++--- apps/docs/src/components/site-chrome.tsx | 2 +- apps/docs/src/virtual.d.ts | 2 ++ apps/docs/vite-plugin-content.ts | 1 + 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/apps/docs/build/meta.ts b/apps/docs/build/meta.ts index 5e5c4c7..a9a1016 100644 --- a/apps/docs/build/meta.ts +++ b/apps/docs/build/meta.ts @@ -79,6 +79,11 @@ if ( export const META = { version, + /** + * The docs package's manifest on GitHub, where `version` is set — on `main`, + * the branch the site deploys from, like the "View source" links. + */ + versionUrl: `${repoUrl}/blob/main/apps/docs/package.json`, siteUrl, repoUrl, /** The repository without its scheme, e.g. `github.com/mixedrays/keyrove`. */ @@ -106,10 +111,10 @@ const PLACEHOLDER = /^
<\/div>$/gm; const renderFacts = () => [ - // Both versions, each beside what it numbers: the footer shows the - // package's, and a lone "Docs version" reads as the release it documents. + // Both versions, each beside what it numbers: a lone "Docs version" reads + // as the release it documents. `- **Package** — [${META.packageName}](${META.npmUrl}) ${META.packageVersion} on npm`, - `- **Docs version** — ${META.version}, numbered separately from the package`, + `- **Docs version** — [${META.version}](${META.versionUrl}), numbered separately from the package`, `- **Repository** — [${META.repoLabel}](${META.repoUrl})`, `- **Author** — [@${META.author}](${META.authorUrl})`, ].join('\n'); diff --git a/apps/docs/src/components/site-chrome.tsx b/apps/docs/src/components/site-chrome.tsx index 5e35c59..f3e089b 100644 --- a/apps/docs/src/components/site-chrome.tsx +++ b/apps/docs/src/components/site-chrome.tsx @@ -102,7 +102,7 @@ export function SiteFooter({ layout }: { layout: Layout }) { keyrove - v{meta.packageVersion} ·{' '} + v{meta.packageVersion} · docs v{meta.docsVersion} ·{' '} MIT licensed diff --git a/apps/docs/src/virtual.d.ts b/apps/docs/src/virtual.d.ts index 2d1048d..d17adcd 100644 --- a/apps/docs/src/virtual.d.ts +++ b/apps/docs/src/virtual.d.ts @@ -28,6 +28,8 @@ declare module 'virtual:docs/site' { export const meta: { packageVersion: string; + /** The docs package's own version, which moves when the site is released. */ + docsVersion: string; repoUrl: string; npmUrl: string; }; diff --git a/apps/docs/vite-plugin-content.ts b/apps/docs/vite-plugin-content.ts index c2569ec..ba941be 100644 --- a/apps/docs/vite-plugin-content.ts +++ b/apps/docs/vite-plugin-content.ts @@ -170,6 +170,7 @@ const toSiteModule = (site: Site, addresses: Addresses) => { const data = { meta: { packageVersion: META.packageVersion, + docsVersion: META.version, repoUrl: META.repoUrl, npmUrl: META.npmUrl, },