docs(plugins): version breaking API guides (#4245)

Keep stable v0.7 guidance available while the client-entry layout is previewed for v0.8. Existing reference and migration URLs redirect to the release that owns their content.
This commit is contained in:
Mohamed Boudra
2026-09-02 23:45:23 +02:00
committed by GitHub
parent ce07732d62
commit 20ecdee72d
15 changed files with 1585 additions and 274 deletions
+11
View File
@@ -157,6 +157,17 @@ export function getDoc(slug: string): Doc | undefined {
return getDocs().find((d) => d.slug === slug);
}
const legacyPluginDocRedirects: Readonly<Record<string, string>> = {
"/docs/plugins/reference": "/docs/plugins/v0.7/reference",
"/docs/plugins/reference.md": "/docs/plugins/v0.7/reference.md",
"/docs/plugins/migration": "/docs/plugins/v0.8/migration",
"/docs/plugins/migration.md": "/docs/plugins/v0.8/migration.md",
};
export function getLegacyDocsRedirect(pathname: string): string | undefined {
return legacyPluginDocRedirects[pathname];
}
function formatLabel(segment: string): string {
return segment.replace(/[-_]+/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
}