From a5a9d98f01b91e002ebc2e6f4361330ee24da905 Mon Sep 17 00:00:00 2001 From: Charles de Dreuille Date: Thu, 13 Jun 2024 10:07:40 +0100 Subject: [PATCH 01/45] Update author.ts --- apps/cms/schemaTypes/author.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/cms/schemaTypes/author.ts b/apps/cms/schemaTypes/author.ts index e380781f..b22e8cd8 100644 --- a/apps/cms/schemaTypes/author.ts +++ b/apps/cms/schemaTypes/author.ts @@ -10,6 +10,11 @@ export default defineType({ title: 'Name', type: 'string', }), + defineField({ + name: 'role', + title: 'Role', + type: 'string', + }), defineField({ name: 'slug', title: 'Slug', From bcbd163a356f9bde9e6821825b9fefe118480d71 Mon Sep 17 00:00:00 2001 From: Charles de Dreuille Date: Thu, 13 Jun 2024 10:25:17 +0100 Subject: [PATCH 02/45] Update author.ts --- apps/cms/schemaTypes/author.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/apps/cms/schemaTypes/author.ts b/apps/cms/schemaTypes/author.ts index b22e8cd8..e380781f 100644 --- a/apps/cms/schemaTypes/author.ts +++ b/apps/cms/schemaTypes/author.ts @@ -10,11 +10,6 @@ export default defineType({ title: 'Name', type: 'string', }), - defineField({ - name: 'role', - title: 'Role', - type: 'string', - }), defineField({ name: 'slug', title: 'Slug', From 93be4f702f1222ded738c2c62c31a181ace99bbd Mon Sep 17 00:00:00 2001 From: Charles de Dreuille Date: Thu, 13 Jun 2024 11:02:13 +0100 Subject: [PATCH 03/45] Add first fetch --- apps/frontpage/app/blog/[slug]/page.tsx | 17 +++ apps/frontpage/app/blog/layout.tsx | 37 ++++++ apps/frontpage/app/blog/page.tsx | 24 ++++ apps/frontpage/lib/sanity/client.ts | 12 ++ apps/frontpage/package.json | 3 + package-lock.json | 147 +++++++++++++++++++++++- 6 files changed, 239 insertions(+), 1 deletion(-) create mode 100644 apps/frontpage/app/blog/[slug]/page.tsx create mode 100644 apps/frontpage/app/blog/layout.tsx create mode 100644 apps/frontpage/app/blog/page.tsx create mode 100644 apps/frontpage/lib/sanity/client.ts diff --git a/apps/frontpage/app/blog/[slug]/page.tsx b/apps/frontpage/app/blog/[slug]/page.tsx new file mode 100644 index 00000000..67295d8d --- /dev/null +++ b/apps/frontpage/app/blog/[slug]/page.tsx @@ -0,0 +1,17 @@ +interface PageProps { + params: { + slug: string[]; + }; +} + +export const generateStaticParams = () => { + const result: { slug: string[] }[] = []; + + return result; +}; + +export default async function Page({ params: { slug } }: PageProps) { + // if (!page) notFound(); + + return
{slug}
; +} diff --git a/apps/frontpage/app/blog/layout.tsx b/apps/frontpage/app/blog/layout.tsx new file mode 100644 index 00000000..fd445617 --- /dev/null +++ b/apps/frontpage/app/blog/layout.tsx @@ -0,0 +1,37 @@ +import type { Metadata } from 'next'; +import { Header, Footer, Container } from '@repo/ui'; +import { fetchGithubCount } from '@repo/utils'; +import { generateDocsTree } from '../../lib/get-tree'; +import { getVersion } from '../../lib/get-version'; +import { Submenu } from '../../components/docs/submenu'; + +export const metadata: Metadata = { + title: 'Storybook', + description: + "Storybook is a frontend workshop for building UI components and pages in isolation. Thousands of teams use it for UI development, testing, and documentation. It's open source and free.", +}; + +export default async function Layout({ + children, + params: { slug }, +}: { + children: React.ReactNode; + params: { slug: string[] }; +}) { + const { number: githubCount } = await fetchGithubCount(); + const activeVersion = getVersion(slug); + const path = `content/docs/${activeVersion.id}`; + const tree = generateDocsTree(path); + + return ( + <> +
} + variant="system" + /> + {children} +