Skip to content

Commit d8a881a

Browse files
Merge pull request #376 from nocodb/fuma-sync
2 parents d297a8f + 0546bbd commit d8a881a

File tree

27 files changed

+1015
-2730
lines changed

27 files changed

+1015
-2730
lines changed

.eslintrc.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

app/blog/[slug]/page.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {blogSource} from "@/lib/source";
22
import Link from "next/link";
33
import {notFound} from "next/navigation";
4-
import {metadataImage} from "@/lib/metadata";
4+
import {getPageImage} from "@/lib/metadata";
55
import {calculateReadingTime} from "@/lib/timeToRead";
66
import defaultMdxComponents from "fumadocs-ui/mdx";
77
import CustomToc from "@/components/blog/CustomToc";
@@ -22,14 +22,26 @@ export async function generateMetadata(props: {
2222
const page = blogSource.getPage([params.slug]);
2323
if (!page) notFound();
2424

25+
const imageUrl = getPageImage(page).url;
2526

26-
return metadataImage.withImage(page.slugs, {
27+
return {
2728
title: page.data.title,
2829
description: page.data.description,
30+
openGraph: {
31+
title: page.data.title,
32+
description: page.data.description,
33+
images: [imageUrl],
34+
},
35+
twitter: {
36+
card: 'summary_large_image',
37+
title: page.data.title,
38+
description: page.data.description,
39+
images: [imageUrl],
40+
},
2941
icons: {
3042
icon: '/img/favicon.png',
3143
}
32-
});
44+
};
3345
}
3446

3547
export default async function page(props: {

app/docs-og/[...slug]/route.tsx

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,36 @@
1-
import {generateOGImage} from 'fumadocs-ui/og';
2-
import {metadataImage} from '@/lib/metadata';
1+
import { getPageImage, blogSource } from '@/lib/metadata';
2+
import { notFound } from 'next/navigation';
3+
import { ImageResponse } from 'next/og';
4+
import { generate as DefaultImage } from 'fumadocs-ui/og';
35

4-
export const GET = metadataImage.createAPI((page) => {
5-
return generateOGImage({
6-
title: page.data.title,
7-
primaryColor: '#3366ff',
8-
description: page.data.description,
9-
});
10-
});
6+
export const revalidate = false;
7+
8+
export async function GET(
9+
_req: Request,
10+
{ params }: { params: Promise<{ slug: string[] }> }
11+
) {
12+
const { slug } = await params;
13+
const page = blogSource.getPage(slug.slice(0, -1));
14+
15+
if (!page) notFound();
16+
17+
return new ImageResponse(
18+
(
19+
<DefaultImage
20+
title={page.data.title}
21+
description={page.data.description}
22+
primaryColor="#3366ff"
23+
/>
24+
),
25+
{
26+
width: 1200,
27+
height: 630,
28+
}
29+
);
30+
}
1131

1232
export function generateStaticParams() {
13-
return metadataImage.generateParams();
33+
return blogSource.getPages().map((page) => ({
34+
slug: getPageImage(page).segments,
35+
}));
1436
}

app/docs/changelog/[...slug]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { PageTOC } from 'fumadocs-ui/layouts/docs/page'
77

88
import { TOCScrollArea } from 'fumadocs-ui/components/layout/toc';
99
import ClerkTOCItems from 'fumadocs-ui/components/layout/toc-clerk';
10-
import { getPageTreePeers } from 'fumadocs-core/server';
10+
import { getPageTreePeers } from 'fumadocs-core/page-tree';
1111
import { Cards, Card } from 'fumadocs-ui/components/card';
1212
import TOCMobile from '@/components/layout/TOCMobile';
1313
import { TOCProvider } from 'fumadocs-ui/components/layout/toc';

app/docs/legal/[[...slug]]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { AnchorProvider } from 'fumadocs-core/toc';
77
import { TOCProvider, TOCScrollArea } from 'fumadocs-ui/components/layout/toc';
88
import { PageTOC } from 'fumadocs-ui/layouts/docs/page'
99
import ClerkTOCItems from 'fumadocs-ui/components/layout/toc-clerk';
10-
import { getPageTreePeers } from 'fumadocs-core/server';
10+
import { getPageTreePeers } from 'fumadocs-core/page-tree';
1111
import { Cards, Card } from 'fumadocs-ui/components/card';
1212
import TOCMobile from '@/components/layout/TOCMobile';
1313

app/docs/product-docs/[[...slug]]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { AnchorProvider } from 'fumadocs-core/toc';
77
import { TOCProvider, TOCScrollArea } from 'fumadocs-ui/components/layout/toc';
88
import { PageTOC } from 'fumadocs-ui/layouts/docs/page'
99
import ClerkTOCItems from 'fumadocs-ui/components/layout/toc-clerk';
10-
import { getPageTreePeers } from 'fumadocs-core/server';
10+
import { getPageTreePeers } from 'fumadocs-core/page-tree';
1111
import { Cards, Card } from 'fumadocs-ui/components/card';
1212
import TOCMobile from '@/components/layout/TOCMobile';
1313

app/docs/scripts/[[...slug]]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { PageTOC } from 'fumadocs-ui/layouts/docs/page'
77
import { TOCProvider, TOCScrollArea } from 'fumadocs-ui/components/layout/toc';
88
import ClerkTOCItems from 'fumadocs-ui/components/layout/toc-clerk';
99
import TOCMobile from '@/components/layout/TOCMobile';
10-
import { getPageTreePeers } from 'fumadocs-core/server';
10+
import { getPageTreePeers } from 'fumadocs-core/page-tree';
1111
import { Cards, Card } from 'fumadocs-ui/components/card';
1212

1313
export default async function Page(props: {

app/docs/self-hosting/[[...slug]]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { AnchorProvider } from 'fumadocs-core/toc';
77
import { TOCProvider, TOCScrollArea } from 'fumadocs-ui/components/layout/toc';
88
import { PageTOC } from 'fumadocs-ui/layouts/docs/page'
99
import ClerkTOCItems from 'fumadocs-ui/components/layout/toc-clerk';
10-
import { getPageTreePeers } from 'fumadocs-core/server';
10+
import { getPageTreePeers } from 'fumadocs-core/page-tree';
1111
import { Cards, Card } from 'fumadocs-ui/components/card';
1212
import TOCMobile from '@/components/layout/TOCMobile';
1313

app/global.css

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@
260260
--font-size-h2: 40px;
261261
--font-size-h3: 24px;
262262

263-
264263
--measurements-radius-x-small: var(--spacing-02);
265264
--measurements-radius-small: var(--spacing-03);
266265
--measurements-radius-medium: var(--spacing-04);
@@ -294,15 +293,13 @@
294293
--font-weight-bold: 700;
295294
--font-weight-black: 800;
296295

297-
298296
--shadow-default: 0px 0px 4px 0px rgba(0, 0, 0, 0.08);
299297
--shadow-hover: 0px 0px 4px 0px rgba(0, 0, 0, 0.24);
300298
--shadow-selected: 0px 0px 0px 2px var(--color-ant-primary-color-outline);
301299
--shadow-selected-ai: 0px 0px 0px 2px rgba(125, 38, 205, 0.24);
302300
--shadow-error: 0px 0px 0px 2px var(--color-ant-error-color-outline);
303301
--shadow-focus: 0px 0px 0px 2px #fff, 0px 0px 0px 4px #3069fe;
304302
--shadow-nc-sm: 0px 3px 1px -2px rgba(0, 0, 0, 0.06), 0px 5px 3px -2px rgba(0, 0, 0, 0.02);
305-
306303
}
307304

308305
@theme inline {
@@ -464,7 +461,6 @@
464461
--radius-lg: var(--radius);
465462
--radius-xl: calc(var(--radius) + 4px);
466463

467-
468464
--shadow-sm: 0px 3px 1px -2px rgba(0, 0, 0, 0.06), 0px 5px 3px -2px rgba(0, 0, 0, 0.02);
469465
--shadow-default: 0px 0px 4px 0px rgba(0, 0, 0, 0.08);
470466
--shadow-hover: 0px 0px 4px 0px rgba(0, 0, 0, 0.24);
@@ -492,7 +488,6 @@
492488
--color-border: var(--color-nc-border-grey-medium);
493489
--color-input: var(--color-nc-content-grey-subtle);
494490

495-
496491
--color-ant-primary-hover: #6e7ef5;
497492
--color-ant-primary-active: #2f36c2;
498493
--color-ant-primary-outline: #4351e833;
@@ -509,7 +504,6 @@
509504
--color-fd-primary: var(--color-nc-content-grey-emphasis);
510505
--color-fd-accent: var(--color-nc-background-grey-medium);
511506

512-
513507
--color-fd-background: var(--color-grey-50);
514508
--color-fd-foreground: var(--color-grey-900);
515509
--color-fd-muted: var(--color-grey-100);
@@ -575,7 +569,6 @@
575569
}
576570
}
577571

578-
579572
[id="nd-home-layout"] {
580573
padding-top: 18px !important;
581574
}
@@ -584,12 +577,10 @@
584577
inset-inline-end: 0 !important;
585578
}
586579

587-
588580
.grecaptcha-badge {
589581
@apply hidden;
590582
}
591583

592-
593584
.nc-docs-layout {
594585
[role="tablist"] {
595586
button:is([role="tab"]):is([aria-selected="true"]) {

app/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type {ReactNode} from 'react';
44
import ClientAnalytics from "@/components/Analytics";
55
import NcSearchDialog from "@/components/layout/Search";
66
import {CustomThemeProvider} from "@/app/ThemeProvider";
7-
import {RootProvider} from "fumadocs-ui/provider";
7+
import {RootProvider} from "fumadocs-ui/provider/next";
88
import { Toaster } from "sonner";
99

1010
const inter = Inter({

0 commit comments

Comments
 (0)