Skip to content

Commit f67fb5e

Browse files
authored
Redirects documentation migration (#165)
* chore: apply redirects v1 * docs: update redirect following drop of index.mdx * chore: fix redirect avec index drop * chore: another round of redirect * fix: redirect conf * docs: bring changes from the site src
1 parent 3446440 commit f67fb5e

4 files changed

Lines changed: 303 additions & 45 deletions

File tree

docs/docusaurus.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { Config } from "@docusaurus/types";
33
import type * as Preset from "@docusaurus/preset-classic";
44
import globalVars from './globalVars';
55
import path from 'path';
6+
import { redirects_migration } from './redirects-doc-migration';
67

78
function getDocsRelative(filePath) {
89
const rootDocsDir = path.join(process.cwd(), 'docs');
@@ -121,6 +122,8 @@ const config: Config = {
121122
from: '/emma/emma/',
122123
to: '/emma/',
123124
},
125+
// This covers all the redirects setup during doc migration
126+
...redirects_migration,
124127
],
125128
},
126129
],
@@ -313,6 +316,11 @@ const config: Config = {
313316
'@docusaurus/theme-mermaid',
314317
],
315318
themeConfig: {
319+
announcementBar: {
320+
id: 'docs-restructure-2026',
321+
content: '📚 New docs structure: content is now grouped by capability, not split across Topics and Guides. <a href="/release-notes/infrahub/docs-restructure"><strong>See what changed →</strong></a>',
322+
isCloseable: true,
323+
},
316324
navbar: {
317325
logo: {
318326
alt: "Infrahub",

docs/redirects-doc-migration.ts

Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
/**
2+
* Consolidated redirect table for the docs migration (Phase 2).
3+
*
4+
* All paths are relative to the site root (no /docs/ prefix) which matches
5+
* the production Docusaurus setup: routeBasePath "/" and baseUrl "/".
6+
*
7+
* Usage in docusaurus.config.ts:
8+
*
9+
* import { redirects } from './redirects';
10+
* // ...
11+
* plugins: [
12+
* ['@docusaurus/plugin-client-redirects', { redirects }],
13+
* ],
14+
*
15+
* Once live, delete docs/redirects-pending/ and this comment block.
16+
*/
17+
18+
type Redirect = { from: string | string[]; to: string };
19+
20+
export const redirects_migration: Redirect[] = [
21+
// ── Schema & Data ─────────────────────────────────────────────────────────
22+
{ from: '/topics/schema', to: '/schema/overview' },
23+
{ from: '/topics/schema-extensions', to: '/schema/extensions' },
24+
{ from: '/topics/schema-display', to: '/schema/field-visibility' },
25+
{ from: '/topics/order-weight', to: '/schema/order-weight' },
26+
{ from: '/topics/labels', to: '/schema/display_label' },
27+
{ from: '/topics/file-object', to: '/schema/file-object' },
28+
{ from: '/topics/schema-attr-kind-number-pool', to: '/schema/number-pool' },
29+
{ from: '/guides/create-schema', to: '/academy/tutorials/build-your-first-schema' },
30+
{ from: '/guides/import-schema', to: '/schema/create-and-load' },
31+
32+
// ── Objects & Object Templates ────────────────────────────────────────────
33+
{ from: '/topics/object-template', to: '/object-templates/overview' },
34+
{ from: '/guides/object-template', to: '/object-templates/use' },
35+
{ from: '/topics/object-conversion', to: '/objects/convert-object-kind' },
36+
{ from: '/topics/metadata', to: '/objects/metadata' },
37+
{ from: '/guides/object-load', to: '/objects/load-from-yaml' },
38+
39+
// ── Profiles ──────────────────────────────────────────────────────────────
40+
{ from: '/topics/profiles', to: '/profiles/overview' },
41+
{ from: '/guides/profiles', to: '/profiles/overview' },
42+
43+
// ── Computed Attributes ───────────────────────────────────────────────────
44+
{ from: '/topics/computed-attributes', to: '/computed-attributes/overview' },
45+
{ from: '/guides/computed-attributes', to: '/computed-attributes/overview' },
46+
47+
// ── Menu Customization ────────────────────────────────────────────────────
48+
{ from: '/guides/menu', to: '/menu/overview' },
49+
50+
// ── Artifact & File Storage ───────────────────────────────────────────────
51+
{ from: '/topics/object-storage', to: '/artifact-file-storage/overview' },
52+
{ from: '/guides/object-storage', to: '/artifact-file-storage/configure' },
53+
54+
// ── Artifacts ─────────────────────────────────────────────────────────────
55+
{ from: '/topics/artifact', to: '/artifacts/overview' },
56+
{ from: '/guides/artifact', to: '/artifacts/use' },
57+
{ from: '/guides/artifact-content-composition', to: '/artifacts/content-composition' },
58+
59+
// ── Transformations ───────────────────────────────────────────────────────
60+
{ from: '/topics/transformation', to: '/transformations/overview' },
61+
{ from: '/guides/jinja2-transform', to: '/academy/tutorials/transformations/build-a-jinja2-transformation' },
62+
{ from: '/guides/python-transform', to: '/academy/tutorials/transformations/build-a-python-transformation' },
63+
64+
// ── Generators ────────────────────────────────────────────────────────────
65+
{ from: '/topics/generator', to: '/generators/overview' },
66+
{ from: '/guides/generator', to: '/academy/tutorials/generators/build-your-first-generator' },
67+
{ from: '/guides/chaining-generators', to: '/academy/tutorials/generators/build-chained-generators' },
68+
{ from: '/topics/modular-generators', to: '/generators/modular' },
69+
{ from: '/guides/modular-generator-best-practices', to: '/generators/modular-best-practices' },
70+
71+
// ── Webhooks ──────────────────────────────────────────────────────────────
72+
{ from: '/topics/webhooks', to: '/webhooks/overview' },
73+
{ from: '/guides/webhooks', to: '/webhooks/create' },
74+
75+
// ── Events ────────────────────────────────────────────────────────────────
76+
{ from: '/topics/events', to: '/events/event-system' },
77+
{ from: '/topics/event-actions', to: '/events/overview' },
78+
{ from: '/guides/events-rules-actions', to: '/events/overview' },
79+
80+
// ── Resource Manager ─────────────────────────────────────────────────────
81+
{ from: '/topics/resource-manager', to: '/resource-manager/overview' },
82+
{ from: '/guides/resource-manager', to: '/resource-manager/overview' },
83+
84+
// ── IPAM ──────────────────────────────────────────────────────────────────
85+
{ from: '/topics/ipam', to: '/ipam/overview' },
86+
87+
// ── Branches & Change Control ─────────────────────────────────────────────
88+
// Branches
89+
{ from: '/branching', to: '/branches/overview' },
90+
{ from: '/topics/branching', to: '/branches/overview' },
91+
// Proposed Changes
92+
{ from: '/proposed-change', to: '/proposed-changes/overview' },
93+
{ from: '/topics/proposed-change', to: '/proposed-changes/overview' },
94+
// Checks
95+
{ from: '/topics/check', to: '/checks/overview' },
96+
{ from: '/guides/check', to: '/academy/tutorials/build-a-check' },
97+
// Git Integration
98+
{ from: '/topics/repository', to: '/git-integration/overview' },
99+
{ from: '/guides/repository', to: '/git-integration/connect-repository' },
100+
{ from: '/topics/infrahub-yml', to: '/git-integration/infrahub-yml' },
101+
{ from: '/topics/branch-synchronization', to: '/git-integration/branch-synchronization' },
102+
{ from: '/guides/selective-branch-sync', to: '/git-integration/branch-synchronization' },
103+
// Change Approval
104+
{ from: '/guides/change-approval-workflow', to: '/change-approval/change-approval-workflow' },
105+
106+
// ── Testing Framework ─────────────────────────────────────────────────────
107+
{ from: '/topics/resources-testing-framework', to: '/testing-framework/overview' },
108+
109+
// ── Development Resources ─────────────────────────────────────────────────
110+
{ from: '/topics/developer-guide', to: '/development-resources/developer-guide' },
111+
{ from: '/topics/graphql', to: '/development-resources/graphql/overview' },
112+
{ from: '/guides/graphql-fragment', to: '/development-resources/graphql-fragments' },
113+
114+
// ── Deploy & Manage — Install & Configure ────────────────────────────────
115+
{ from: '/topics/hardware-requirements', to: '/deploy-manage/install-configure/hardware-requirements' },
116+
{ from: '/guides/installation', to: '/deploy-manage/install-configure/install/overview' },
117+
{ from: '/guides/production-deployment', to: '/deploy-manage/install-configure/production-deployment/overview' },
118+
{ from: '/guides/configuration-changes', to: '/deploy-manage/install-configure/configure-infrahub' },
119+
120+
// ── Deploy & Manage — Run & Observe ──────────────────────────────────────
121+
{ from: '/topics/tasks', to: '/deploy-manage/run-observe/tasks' },
122+
{ from: '/guides/telemetry', to: '/deploy-manage/run-observe/telemetry' },
123+
{ from: '/topics/activity-log', to: '/deploy-manage/run-observe/activity-log' },
124+
{ from: '/topics/log-forwarding', to: '/deploy-manage/run-observe/log-forwarding/overview' },
125+
{ from: '/guides/log-forwarding', to: '/deploy-manage/run-observe/log-forwarding/configure-log-forwarding' },
126+
127+
// ── Deploy & Manage — Maintain & Upgrade ────────────────────────────────
128+
{ from: '/guides/upgrade', to: '/deploy-manage/maintain-upgrade/upgrade/overview' },
129+
{ from: '/topics/database-backup', to: '/deploy-manage/maintain-upgrade/database-backup/overview' },
130+
{ from: '/guides/database-backup', to: '/deploy-manage/maintain-upgrade/database-backup/backup-and-restore' },
131+
132+
// ── Deploy & Manage — User Management & Security ─────────────────────────
133+
{ from: '/topics/authentication', to: '/deploy-manage/user-management/authentication' },
134+
{ from: '/guides/sso', to: '/deploy-manage/user-management/sso/overview' },
135+
{ from: '/topics/permissions-roles', to: '/deploy-manage/user-management/permissions-roles/overview' },
136+
{ from: '/guides/accounts-permissions', to: '/deploy-manage/user-management/permissions-roles/manage-accounts-and-permissions' },
137+
{ from: '/guides/managing-api-tokens', to: '/deploy-manage/user-management/managing-api-tokens' },
138+
139+
// ── Missing guide pages ───────────────────────────────────────────────────
140+
{ from: '/guides/customize-field-ordering', to: '/schema/order-weight' },
141+
{ from: '/guides/groups', to: '/groups/overview' },
142+
{ from: '/guides/object-conversion', to: '/objects/convert-object-kind' },
143+
144+
// ── Missing topic pages ───────────────────────────────────────────────────
145+
{ from: '/topics/architecture', to: '/overview/architecture' },
146+
{ from: '/topics/bus-event-handling', to: '/reference/message-bus-events' },
147+
{ from: '/topics/community-vs-enterprise', to: '/overview/community-vs-enterprise' },
148+
{ from: '/topics/groups', to: '/groups/overview' },
149+
{ from: '/topics/local-demo-environment', to: '/development-resources/local-demo-environment' },
150+
{ from: '/topics/version-control', to: '/immutable-history/overview' },
151+
152+
// ── Legacy top-level section indexes ─────────────────────────────────────
153+
// /guides and /topics were Docusaurus generated-index pages for the old sidebar
154+
// sections. Both sections have been replaced by the new domain-based structure.
155+
{ from: ['/guides', '/topics'], to: '/' },
156+
157+
// ── Legacy category index pages ───────────────────────────────────────────
158+
// These /category/* URLs were auto-generated by Docusaurus from the old sidebar
159+
// category labels. Slugs: spaces→hyphens, "&"→double-hyphens, duplicates→-1 suffix.
160+
161+
// Old "Guides" sub-categories
162+
{ from: '/category/installation--setup', to: '/deploy-manage/install-configure/install/overview' },
163+
{ from: '/category/schema--data-modeling', to: '/schema-and-data' },
164+
{ from: '/category/data-management', to: '/schema-and-data' },
165+
{ from: '/category/artifact--transform', to: '/automation-and-outputs' },
166+
{ from: '/category/generators', to: '/generators/overview' },
167+
{ from: '/category/integration--events', to: '/events/overview' },
168+
{ from: '/category/user-management--authentication', to: '/deploy-manage/user-management/authentication' },
169+
170+
// Old "Topics > Overview" sub-category
171+
{ from: '/category/overview', to: '/overview' },
172+
173+
// Old "Topics > Core Concepts" and its sub-categories
174+
{ from: '/category/core-concepts', to: '/schema-and-data' },
175+
{ from: '/category/git-integration', to: '/git-integration/overview' },
176+
{ from: '/category/transforms--artifacts', to: '/automation-and-outputs' },
177+
{ from: '/category/generators-1', to: '/generators/overview' },
178+
{ from: '/category/version-control--branching', to: '/branches-and-change-control' },
179+
{ from: '/category/file-storage', to: '/artifact-file-storage/overview' },
180+
{ from: '/category/schema', to: '/schema/overview' },
181+
{ from: '/category/data-management-1', to: '/schema-and-data' },
182+
{ from: '/category/ipam', to: '/ipam/overview' },
183+
184+
// Old "Topics > Platform Capabilities" and its sub-categories
185+
{ from: '/category/platform-capabilities', to: '/deployment-and-management' },
186+
{ from: '/category/user-management--authentication-1', to: '/deploy-manage/user-management/authentication' },
187+
{ from: '/category/event-management--logging', to: '/events/overview' },
188+
{ from: '/category/system-administration', to: '/deployment-and-management' },
189+
190+
// Old "Topics > Development Resources"
191+
{ from: '/category/development-resources', to: '/development-resources' },
192+
193+
// ── Deploy & Manage sub-hub index → overview backward-compat ───────────────
194+
// Old /X/ URLs for deploy-manage sub-folders and graphql (from index.mdx) now redirect to /X/overview.
195+
{ from: '/deploy-manage/install-configure/install', to: '/deploy-manage/install-configure/install/overview' },
196+
{ from: '/deploy-manage/install-configure/production-deployment', to: '/deploy-manage/install-configure/production-deployment/overview' },
197+
{ from: '/deploy-manage/run-observe/log-forwarding', to: '/deploy-manage/run-observe/log-forwarding/overview' },
198+
{ from: '/deploy-manage/maintain-upgrade/database-backup', to: '/deploy-manage/maintain-upgrade/database-backup/overview' },
199+
{ from: '/deploy-manage/maintain-upgrade/upgrade', to: '/deploy-manage/maintain-upgrade/upgrade/overview' },
200+
{ from: '/deploy-manage/user-management/sso', to: '/deploy-manage/user-management/sso/overview' },
201+
{ from: '/deploy-manage/user-management/permissions-roles', to: '/deploy-manage/user-management/permissions-roles/overview' },
202+
{ from: '/development-resources/graphql', to: '/development-resources/graphql/overview' },
203+
204+
// ── Feature hub index → overview backward-compat ─────────────────────────
205+
// Old canonical /X/ URLs (from index.mdx) now redirect to /X/overview.
206+
{ from: '/schema', to: '/schema/overview' },
207+
{ from: '/artifact-file-storage', to: '/artifact-file-storage/overview' },
208+
{ from: '/artifacts', to: '/artifacts/overview' },
209+
{ from: '/branches', to: '/branches/overview' },
210+
{ from: '/checks', to: '/checks/overview' },
211+
{ from: '/computed-attributes', to: '/computed-attributes/overview' },
212+
{ from: '/events', to: '/events/overview' },
213+
{ from: '/generators', to: '/generators/overview' },
214+
{ from: '/git-integration', to: '/git-integration/overview' },
215+
{ from: '/groups', to: '/groups/overview' },
216+
{ from: '/immutable-history', to: '/immutable-history/overview' },
217+
{ from: '/ipam', to: '/ipam/overview' },
218+
{ from: '/menu', to: '/menu/overview' },
219+
{ from: '/object-templates', to: '/object-templates/overview' },
220+
{ from: '/objects', to: '/objects/overview' },
221+
{ from: '/profiles', to: '/profiles/overview' },
222+
{ from: '/proposed-changes', to: '/proposed-changes/overview' },
223+
{ from: '/resource-manager', to: '/resource-manager/overview' },
224+
{ from: '/testing-framework', to: '/testing-framework/overview' },
225+
{ from: '/transformations', to: '/transformations/overview' },
226+
{ from: '/webhooks', to: '/webhooks/overview' },
227+
];

docs/src/components/HomePage/header.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ import clsx from 'clsx';
33
import Heading from '@theme/Heading'
44
import Link from '@docusaurus/Link';
55
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
6+
import useBaseUrl from '@docusaurus/useBaseUrl';
67
import styles from './styles.module.css';
78
import { translate } from '@docusaurus/Translate';
8-
import ArrowRightIcon from "/img/arrow-right.svg";
9-
import EducationIcon from "/img/education.svg";
9+
import ArrowRightIcon from "@site/static/img/arrow-right.svg";
10+
import EducationIcon from "@site/static/img/education.svg";
1011

1112
export default function HomepageHeader() {
1213
const { siteConfig } = useDocusaurusContext();
14+
const videoUrl = useBaseUrl('/medias/demo.mp4');
1315

1416
return (
1517
<header className={clsx('container', styles.heroBanner)}>
@@ -34,6 +36,16 @@ export default function HomepageHeader() {
3436

3537
<ArrowRightIcon />
3638
</Link>
39+
<Link
40+
className={clsx(styles.heroButton, "button button--secondary button--lg")}
41+
to="overview/community-vs-enterprise"
42+
>
43+
{translate({
44+
id: 'home.header.editions',
45+
message: 'Community vs Enterprise',
46+
})}
47+
<ArrowRightIcon />
48+
</Link>
3749
<Link
3850
className={clsx(styles.heroButton, "button button--secondary button--lg")}
3951
to="https://sandbox.infrahub.app/"
@@ -64,7 +76,7 @@ export default function HomepageHeader() {
6476
maxHeight: "540px"
6577
}}
6678
className="rounded-2xl" height="100%" loop autoPlay muted>
67-
<source src="/medias/demo.mp4" type="video/mp4" />
79+
<source src={videoUrl} type="video/mp4" />
6880
</video>
6981
</div>
7082
</header>

0 commit comments

Comments
 (0)