Skip to content

Commit 939f75b

Browse files
tlgimenesclaude
andauthored
docs: migrate to date-based versioning and reorganize sidebar UI (#2653)
* docs: migrate to date-based versioning and reorganize sidebar UI Implement major documentation system overhaul: - Convert version naming from "latest"/"previous" to date-based identifiers (2026-03-10 current, 2025-10-10 previous) with backward-compatible /latest/* redirect - Upgrade GitHub repository URLs from decocms/mesh to decocms/studio across all docs - Reorganize sidebar layout: move language selector and theme toggle to header row, version selector to footer with "Version" label, add "(latest)" flag to current version - Complete Portuguese (pt-br) translations for all documentation content, ensuring feature parity between stable and previous versions in both languages - Implement server-side URL rewriting and static path generation for seamless version aliasing Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * fix(docs): repair broken URLs and links from PR review feedback - Fix "deco CMS" with spaces in URLs, GitHub paths, Docker image refs, and domain names across PT-BR and EN deploy/self-hosting docs - Update GitHub link in Sidebar.tsx from deco-cx/chat to decocms/studio to match the stars API endpoint - Preserve query parameters in /latest/* server redirects - Update GitHub Actions benchmark link from decocms/mesh to decocms/studio Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent 99bcc35 commit 939f75b

157 files changed

Lines changed: 5674 additions & 1948 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/docs/astro.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default defineConfig({
4242
port: 4000,
4343
},
4444
redirects: {
45-
"/": "/latest/en/introduction",
45+
"/": "/2026-03-10/en/mcp-mesh/quickstart",
4646
},
4747
outDir: "dist/client/",
4848
srcDir: "client/src",

apps/docs/client/src/components/ui/Sidebar.astro

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
import { getCollection } from "astro:content";
33
import { ui } from "../../i18n/ui";
44
import SidebarComponent from "./Sidebar";
5+
import { LATEST_VERSION } from "../../config/versions";
56
6-
const version = Astro.params.version || "latest";
7+
const version = Astro.params.version || LATEST_VERSION.id;
78
const locale = Astro.params.locale;
89
910
const allDocs = await getCollection("docs");
@@ -74,23 +75,9 @@ function buildTree(docs: any[]): TreeNode[] {
7475
7576
// Version-aware ordering
7677
const mcpMeshOrder =
77-
version === "latest"
78+
version === LATEST_VERSION.id
7879
? [
79-
// Latest version (origin/main structure)
80-
"overview",
81-
"quickstart",
82-
"concepts",
83-
"connect-clients",
84-
"authentication",
85-
"authorization-and-roles",
86-
"mcp-servers",
87-
"mcp-gateways",
88-
"api-keys",
89-
"monitoring",
90-
"api-reference",
91-
]
92-
: [
93-
// Draft version structure
80+
// Latest version structure
9481
"quickstart",
9582
"overview",
9683
"concepts",
@@ -102,6 +89,20 @@ function buildTree(docs: any[]): TreeNode[] {
10289
"api-keys",
10390
"user-management",
10491
"api-reference",
92+
]
93+
: [
94+
// Previous version structure
95+
"overview",
96+
"quickstart",
97+
"concepts",
98+
"connect-clients",
99+
"authentication",
100+
"authorization-and-roles",
101+
"mcp-servers",
102+
"mcp-gateways",
103+
"api-keys",
104+
"monitoring",
105+
"api-reference",
105106
];
106107
107108
const aIndex = mcpMeshOrder.indexOf(a.name);
@@ -212,9 +213,9 @@ function buildTree(docs: any[]): TreeNode[] {
212213
if (rootPath === "mcp-mesh" && parentPath === "deploy") {
213214
// Version-aware deploy file names
214215
const deployOrder =
215-
version === "latest"
216-
? ["local-docker-compose", "kubernetes-helm-chart"]
217-
: ["docker-compose", "kubernetes"];
216+
version === LATEST_VERSION.id
217+
? ["docker-compose", "kubernetes"]
218+
: ["local-docker-compose", "kubernetes-helm-chart"];
218219
const aIndex = deployOrder.indexOf(a.name);
219220
const bIndex = deployOrder.indexOf(b.name);
220221
if (aIndex !== -1 && bIndex !== -1) {

apps/docs/client/src/components/ui/Sidebar.tsx

Lines changed: 25 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { Icon } from "../../components/atoms/Icon";
55
import { Select } from "../../components/atoms/Select";
66
import { LanguageSelector } from "./LanguageSelector";
77
import { ThemeToggle } from "./ThemeToggle";
8+
import { versions, VERSION_IDS, LATEST_VERSION } from "../../config/versions";
89

910
// GitHub Stars Component
1011
function GitHubStars() {
@@ -15,7 +16,7 @@ function GitHubStars() {
1516
const fetchStars = async () => {
1617
try {
1718
const response = await fetch(
18-
"https://api.github.com/repos/decocms/mesh",
19+
"https://api.github.com/repos/decocms/studio",
1920
);
2021
if (response.ok) {
2122
const data = await response.json();
@@ -70,7 +71,7 @@ function VersionSelector({
7071

7172
const handlePopState = () => {
7273
const params = new URLSearchParams(window.location.search);
73-
const version = params.get("version") || "latest";
74+
const version = params.get("version") || LATEST_VERSION.id;
7475
setCurrentVersion(version);
7576
onVersionChange(version);
7677
};
@@ -81,20 +82,7 @@ function VersionSelector({
8182
// eslint-disable-next-line react-hooks/exhaustive-deps
8283
}, []); // Empty deps - only setup listener once
8384

84-
const versions = [
85-
{
86-
id: "latest",
87-
label: "Latest (Stable)",
88-
shortLabel: "Stable",
89-
description: "Current production docs",
90-
},
91-
{
92-
id: "draft",
93-
label: "Draft",
94-
shortLabel: "Draft",
95-
description: "In-progress documentation",
96-
},
97-
];
85+
const versionOptions = versions;
9886

9987
const handleVersionChange = (newVersion: string) => {
10088
if (newVersion === currentVersion) return;
@@ -105,15 +93,16 @@ function VersionSelector({
10593

10694
if (inline) {
10795
return (
108-
<div className="relative">
96+
<div className="relative flex-1">
10997
<select
11098
value={currentVersion}
11199
onChange={(e) => handleVersionChange(e.target.value)}
112-
className="h-8 pl-2 pr-6 text-xs bg-transparent border border-border rounded-md text-muted-foreground appearance-none cursor-pointer focus:outline-none focus:ring-1 focus:ring-ring"
100+
className="w-full h-8 pl-2 pr-6 text-xs bg-transparent border border-border rounded-md text-muted-foreground appearance-none cursor-pointer focus:outline-none focus:ring-1 focus:ring-ring"
113101
>
114-
{versions.map((v) => (
102+
{versionOptions.map((v) => (
115103
<option key={v.id} value={v.id}>
116104
{v.shortLabel}
105+
{v.isLatest ? " (latest)" : ""}
117106
</option>
118107
))}
119108
</select>
@@ -134,13 +123,13 @@ function VersionSelector({
134123
Documentation Version
135124
</label>
136125
<Select
137-
options={versions.map((v) => ({ value: v.id, label: v.label }))}
126+
options={versionOptions.map((v) => ({ value: v.id, label: v.label }))}
138127
value={currentVersion}
139128
icon="BookOpen"
140129
onChange={(e) => handleVersionChange(e.target.value)}
141130
/>
142131
<p className="text-xs text-muted mt-1">
143-
{versions.find((v) => v.id === currentVersion)?.description}
132+
{versionOptions.find((v) => v.id === currentVersion)?.description}
144133
</p>
145134
</div>
146135
);
@@ -437,7 +426,7 @@ export default function Sidebar({
437426
setCurrentPath(path);
438427
// Keep version in sync with the URL (e.g. after browser back/forward)
439428
const urlVersion = path.split("/")[1];
440-
if (urlVersion === "latest" || urlVersion === "draft") {
429+
if (VERSION_IDS.includes(urlVersion)) {
441430
setVersion(urlVersion);
442431
}
443432
// Restore scroll after React finishes re-rendering (rAF fires after paint)
@@ -456,15 +445,10 @@ export default function Sidebar({
456445
}, []);
457446

458447
// Handle version change by navigating to the new version's root page
459-
const versionRoots: Record<string, string> = {
460-
latest: "introduction",
461-
draft: "mcp-mesh/quickstart",
462-
};
448+
const versionRoots = Object.fromEntries(versions.map((v) => [v.id, v.root]));
463449
const handleVersionChange = (newVersion: string) => {
464450
const root = versionRoots[newVersion] ?? "mcp-mesh/quickstart";
465-
// Draft is English-only; fall back to "en" when switching to it
466-
const targetLocale = newVersion === "draft" ? "en" : locale;
467-
navigate(`/${newVersion}/${targetLocale}/${root}`);
451+
navigate(`/${newVersion}/${locale}/${root}`);
468452
};
469453

470454
// Initialize with default state (same on server and client for hydration match)
@@ -569,16 +553,7 @@ export default function Sidebar({
569553
<div className="hidden lg:flex items-center justify-between px-4 lg:px-6 py-3 shrink-0 border-b border-border">
570554
<Logo width={67} height={28} />
571555
<div className="flex items-center gap-1.5">
572-
<VersionSelector
573-
currentVersion={version}
574-
onVersionChange={handleVersionChange}
575-
inline
576-
/>
577-
<LanguageSelector
578-
locale={locale}
579-
compact
580-
disabled={version === "draft"}
581-
/>
556+
<LanguageSelector locale={locale} compact />
582557
<ThemeToggle />
583558
</div>
584559
</div>
@@ -599,8 +574,18 @@ export default function Sidebar({
599574
{/* Footer */}
600575
<div className="px-4 lg:px-8 py-4 border-t border-border shrink-0">
601576
<div className="space-y-2">
577+
<div>
578+
<label className="block text-xs font-medium text-muted-foreground mb-1">
579+
Version
580+
</label>
581+
<VersionSelector
582+
currentVersion={version}
583+
onVersionChange={handleVersionChange}
584+
inline
585+
/>
586+
</div>
602587
<a
603-
href="https://github.com/deco-cx/chat"
588+
href="https://github.com/decocms/studio"
604589
target="_blank"
605590
rel="noopener noreferrer"
606591
className="flex items-center gap-3 px-3 py-2 rounded-lg text-sm text-foreground hover:bg-muted hover:text-foreground transition-colors"

apps/docs/client/src/config/site.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ export const siteConfig = {
44
url: "https://your-domain.com",
55
ogImage: "https://your-domain.com/og.jpg",
66
links: {
7-
github: "https://github.com/decocms/mesh",
7+
github: "https://github.com/decocms/studio",
88
},
99
// GitHub repository URL for edit links
10-
githubRepo: "https://github.com/decocms/mesh",
10+
githubRepo: "https://github.com/decocms/studio",
1111
// GitHub branch name (usually 'main' or 'master')
1212
githubBranch: "main",
1313
} as const;
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
export interface VersionConfig {
2+
id: string;
3+
label: string;
4+
shortLabel: string;
5+
description: string;
6+
isLatest: boolean;
7+
root: string;
8+
}
9+
10+
export const versions: VersionConfig[] = [
11+
{
12+
id: "2026-03-10",
13+
label: "2026-03-10 (Current)",
14+
shortLabel: "2026-03-10",
15+
description: "Current production docs",
16+
isLatest: true,
17+
root: "mcp-mesh/quickstart",
18+
},
19+
{
20+
id: "2025-10-10",
21+
label: "2025-10-10",
22+
shortLabel: "2025-10-10",
23+
description: "Previous version docs",
24+
isLatest: false,
25+
root: "introduction",
26+
},
27+
];
28+
29+
export const LATEST_VERSION = versions.find((v) => v.isLatest)!;
30+
export const VERSION_IDS = versions.map((v) => v.id);

apps/docs/client/src/content/latest/en/api-reference/built-in-tools/user-ask.mdx renamed to apps/docs/client/src/content/2025-10-10/en/api-reference/built-in-tools/user-ask.mdx

File renamed without changes.

apps/docs/client/src/content/latest/en/full-code-guides/building-tools.mdx renamed to apps/docs/client/src/content/2025-10-10/en/full-code-guides/building-tools.mdx

File renamed without changes.

apps/docs/client/src/content/latest/en/full-code-guides/building-views.mdx renamed to apps/docs/client/src/content/2025-10-10/en/full-code-guides/building-views.mdx

File renamed without changes.

apps/docs/client/src/content/latest/en/full-code-guides/deployment.mdx renamed to apps/docs/client/src/content/2025-10-10/en/full-code-guides/deployment.mdx

File renamed without changes.

apps/docs/client/src/content/latest/en/full-code-guides/project-structure.mdx renamed to apps/docs/client/src/content/2025-10-10/en/full-code-guides/project-structure.mdx

File renamed without changes.

0 commit comments

Comments
 (0)