diff --git a/microsite-canon/app/core-concepts/[slug]/page.tsx b/microsite-canon/app/[slug]/page.tsx
similarity index 74%
rename from microsite-canon/app/core-concepts/[slug]/page.tsx
rename to microsite-canon/app/[slug]/page.tsx
index 35be6dc2c9..8bd03a42fe 100644
--- a/microsite-canon/app/core-concepts/[slug]/page.tsx
+++ b/microsite-canon/app/[slug]/page.tsx
@@ -1,8 +1,9 @@
-import { coreConcepts } from '@/utils/data';
+import { overview } from '@/utils/data';
import { notFound } from 'next/navigation';
import fs from 'fs';
import path from 'path';
-import styles from './page.module.css';
+import styles from '../page.module.css';
+
export default async function Page({
params,
}: {
@@ -13,8 +14,9 @@ export default async function Page({
if (fs.existsSync(filePath)) {
const { default: Post } = await import(`@/content/${slug}.mdx`);
+
return (
-
+
);
@@ -24,7 +26,7 @@ export default async function Page({
}
export function generateStaticParams() {
- return coreConcepts.map(concept => ({ slug: concept.slug }));
+ return overview.map(page => ({ slug: page.slug }));
}
export const dynamicParams = false;
diff --git a/microsite-canon/app/core-concepts/[slug]/page.module.css b/microsite-canon/app/core-concepts/[slug]/page.module.css
deleted file mode 100644
index b89fa65437..0000000000
--- a/microsite-canon/app/core-concepts/[slug]/page.module.css
+++ /dev/null
@@ -1,6 +0,0 @@
-.container {
- width: 100%;
- max-width: 960px;
- margin: 0 auto;
- padding: 0 24px 64px;
-}
diff --git a/microsite-canon/app/layout.tsx b/microsite-canon/app/layout.tsx
index 560f1e24b7..5d3c54f3ef 100644
--- a/microsite-canon/app/layout.tsx
+++ b/microsite-canon/app/layout.tsx
@@ -6,9 +6,9 @@ import { Providers } from './providers';
import { cookies } from 'next/headers';
import './globals.css';
-import '../../packages/canon/src/css/core.css';
-import '../../packages/canon/src/css/components.css';
-import '../../packages/canon/.storybook/themes/backstage.css';
+import '@/public/core.css';
+import '@/public/components.css';
+import '@/public/backstage.css';
export const metadata: Metadata = {
title: 'Canon',
@@ -22,16 +22,10 @@ export default async function RootLayout({
}>) {
const cookieStore = await cookies();
const theme = cookieStore.get('theme')?.value || 'light';
- const version = cookieStore.get('version')?.value || 'v1';
-
- let dataTheme = 'light';
- if (version === 'v1' && theme === 'light') dataTheme = 'backstage-light';
- if (version === 'v1' && theme === 'dark') dataTheme = 'backstage-dark';
- if (version === 'v2' && theme === 'light') dataTheme = 'light';
- if (version === 'v2' && theme === 'dark') dataTheme = 'dark';
+ const version = cookieStore.get('version')?.value || 'v2';
return (
-
+
diff --git a/microsite-canon/app/page.module.css b/microsite-canon/app/page.module.css
index 0649f84c65..9119d2e9c5 100644
--- a/microsite-canon/app/page.module.css
+++ b/microsite-canon/app/page.module.css
@@ -3,7 +3,7 @@
}
.container {
- padding-left: 280px;
+ padding-left: 300px;
width: 100%;
}
@@ -35,3 +35,10 @@
width: 100%;
height: auto;
}
+
+.pageContainer {
+ width: 100%;
+ max-width: 960px;
+ margin: 0 auto;
+ padding: 0 24px 64px;
+}
diff --git a/microsite-canon/app/page.tsx b/microsite-canon/app/page.tsx
index 0c11528d93..a6429cb79d 100644
--- a/microsite-canon/app/page.tsx
+++ b/microsite-canon/app/page.tsx
@@ -1,4 +1,5 @@
import styles from './page.module.css';
+
export default async function Page() {
const { default: Post } = await import(`@/content/home.mdx`);
@@ -8,5 +9,3 @@ export default async function Page() {
);
}
-
-export const dynamicParams = false;
diff --git a/microsite-canon/app/theme/[slug]/page.tsx b/microsite-canon/app/theme/[slug]/page.tsx
new file mode 100644
index 0000000000..41031f143c
--- /dev/null
+++ b/microsite-canon/app/theme/[slug]/page.tsx
@@ -0,0 +1,33 @@
+import { theme } from '@/utils/data';
+import { notFound } from 'next/navigation';
+import fs from 'fs';
+import path from 'path';
+import styles from '../../page.module.css';
+
+export default async function Page({
+ params,
+}: {
+ params: Promise<{ slug: string }>;
+}) {
+ const slug = (await params).slug;
+ const filePath = path.resolve(process.cwd(), `content/${slug}.mdx`);
+
+ if (fs.existsSync(filePath)) {
+ const { default: Post } = await import(`@/content/${slug}.mdx`);
+ return (
+
+ );
+ } else {
+ return notFound();
+ }
+}
+
+export function generateStaticParams() {
+ return theme.map(component => ({
+ slug: component.slug,
+ }));
+}
+
+export const dynamicParams = false;
diff --git a/microsite-canon/components/Sidebar/Sidebar.module.css b/microsite-canon/components/Sidebar/Sidebar.module.css
index 738e7877c2..ac9aefb0a6 100644
--- a/microsite-canon/components/Sidebar/Sidebar.module.css
+++ b/microsite-canon/components/Sidebar/Sidebar.module.css
@@ -2,7 +2,7 @@
position: fixed;
top: 0;
left: 0;
- width: 280px;
+ width: 300px;
height: 100vh;
color: var(--canon-text-primary);
background-color: var(--canon-surface-1);
@@ -30,7 +30,6 @@
}
.menu {
- margin-top: 20px;
display: flex;
flex-direction: row;
position: relative;
diff --git a/microsite-canon/components/Sidebar/docs.tsx b/microsite-canon/components/Sidebar/docs.tsx
index 8d1e079768..1c88adcc34 100644
--- a/microsite-canon/components/Sidebar/docs.tsx
+++ b/microsite-canon/components/Sidebar/docs.tsx
@@ -1,11 +1,35 @@
'use client';
import Link from 'next/link';
-import { components, coreConcepts, layoutComponents } from '@/utils/data';
+import { components, overview, layoutComponents, theme } from '@/utils/data';
import { Box, Text } from '@backstage/canon';
import { motion } from 'framer-motion';
import styles from './Sidebar.module.css';
import { usePathname } from 'next/navigation';
+import { Fragment } from 'react';
+
+const data = [
+ {
+ title: 'Overview',
+ content: overview,
+ url: '',
+ },
+ {
+ title: 'Theme',
+ content: theme,
+ url: '/theme',
+ },
+ {
+ title: 'Layout Components',
+ content: layoutComponents,
+ url: '/components',
+ },
+ {
+ title: 'Components',
+ content: components,
+ url: '/components',
+ },
+];
export const Docs = () => {
const pathname = usePathname();
@@ -26,35 +50,33 @@ export const Docs = () => {
}}
transition={{ duration: 0.2 }}
>
-
-
- Core Concepts
-
-
- {coreConcepts.map(concept => (
-
- {concept.title}
-
- ))}
-
-
- Layout Components
-
-
- {layoutComponents.map(component => (
-
- {component.title}
-
- ))}
-
-
- Components
-
-
- {components.map(component => (
-
- {component.title}
-
+ {data.map(section => (
+
+
+
+ {section.title}
+
+
+ {section.content.map(item => (
+
+ {item.title}
+
+ {item.status === 'alpha' && 'Alpha'}
+ {item.status === 'beta' && 'Beta'}
+ {item.status === 'inProgress' && 'In Progress'}
+ {item.status === 'stable' && 'Stable'}
+ {item.status === 'deprecated' && 'Deprecated'}
+
+
+ ))}
+
))}
);
diff --git a/microsite-canon/components/Sidebar/playground.tsx b/microsite-canon/components/Sidebar/playground.tsx
index e20aa2e137..5e784c7235 100644
--- a/microsite-canon/components/Sidebar/playground.tsx
+++ b/microsite-canon/components/Sidebar/playground.tsx
@@ -52,8 +52,8 @@ export const Playground = () => {
transition={{ duration: 0.2 }}
style={{ position: 'absolute' }}
>
-
-
+
+
Components
@@ -66,8 +66,8 @@ export const Playground = () => {
/>
))}
-