From a252c5ae0bb0595d9b52a644e1c4a61765ee99a0 Mon Sep 17 00:00:00 2001 From: JT Date: Sun, 30 Aug 2026 15:39:40 -0700 Subject: [PATCH] docs: derive release-notes nav from the release-notes directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The nav link and sidebar list hardcoded 2.16.2, so the freshly-published 2.16.3 page was live but unreachable from the site nav. Both now derive from the files in docs/release-notes/ (newest first) — adding a release's page is the whole job. Co-Authored-By: Claude Fable 5 --- docs/.vitepress/config.mts | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 54674375f..0aba90ddb 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -1,5 +1,17 @@ +import { readdirSync } from 'node:fs' +import { dirname, join } from 'node:path' +import { fileURLToPath } from 'node:url' import { defineConfig } from 'vitepress' +// Release-notes nav derives from the files in docs/release-notes/ so adding a +// page is enough — no second place to update (newest first). +const releaseNotes = readdirSync( + join(dirname(fileURLToPath(import.meta.url)), '..', 'release-notes') +) + .filter((f) => /^\d+\.\d+\.\d+\.md$/.test(f)) + .map((f) => f.replace(/\.md$/, '')) + .sort((a, b) => b.localeCompare(a, undefined, { numeric: true })) + export default defineConfig({ title: 'Stability Matrix Docs', description: 'Documentation for Stability Matrix, a multi-platform package manager for Stable Diffusion and related AI tools.', @@ -86,7 +98,7 @@ export default defineConfig({ { text: 'Advanced', link: '/stability-matrix/advanced/overview' }, { text: 'Tips and Tricks', link: '/stability-matrix/tips/overview' }, { text: 'Troubleshooting', link: '/stability-matrix/troubleshooting/common-issues' }, - { text: 'Release Notes', link: '/stability-matrix/release-notes/2.16.2' } + { text: 'Release Notes', link: `/stability-matrix/release-notes/${releaseNotes[0]}` } ], sidebar: { @@ -150,9 +162,10 @@ export default defineConfig({ '/stability-matrix/release-notes/': [ { text: 'Release Notes', - items: [ - { text: 'v2.16.2', link: '/stability-matrix/release-notes/2.16.2' } - ] + items: releaseNotes.map((v) => ({ + text: `v${v}`, + link: `/stability-matrix/release-notes/${v}` + })) } ] },