Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions apps/docs/app/[lang]/blog/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { notFound } from 'next/navigation';
import { blog } from '@/app/source';
import defaultMdxComponents from 'fumadocs-ui/mdx';
import { blog } from '@/lib/source';
import { getMDXComponents } from '@/mdx-components';
import { HomeLayout } from 'fumadocs-ui/layouts/home';
import { baseOptions } from '@/app/layout.config';
import { baseOptions } from '@/lib/layout.shared';
import Link from 'next/link';
import { ArrowLeft } from 'lucide-react';

Expand All @@ -16,9 +16,7 @@ interface BlogPostData {
body: React.ComponentType;
}

const components = {
...defaultMdxComponents,
} as any;
const components = getMDXComponents() as any;

export default async function BlogPage({
params,
Expand All @@ -32,7 +30,7 @@ export default async function BlogPage({
const posts = blog.getPages();

return (
<HomeLayout {...baseOptions}>
<HomeLayout {...baseOptions()}>
<main className="container max-w-5xl mx-auto px-4 py-16">
<div className="mb-12">
<h1 className="text-4xl font-bold mb-4">Blog</h1>
Expand Down Expand Up @@ -114,7 +112,7 @@ export default async function BlogPage({
const MDX = page.data.body;

return (
<HomeLayout {...baseOptions}>
<HomeLayout {...baseOptions()}>
<main className="container max-w-4xl mx-auto px-4 py-16">
<Link
href="/blog"
Expand Down
55 changes: 30 additions & 25 deletions apps/docs/app/[lang]/docs/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
import { source } from '@/app/source';
import { source } from '@/lib/source';
import type { Metadata } from 'next';
import { DocsPage, DocsBody } from 'fumadocs-ui/page';
import { DocsBody, DocsDescription, DocsPage, DocsTitle } from 'fumadocs-ui/layouts/docs/page';
import { notFound } from 'next/navigation';
import defaultMdxComponents from 'fumadocs-ui/mdx';
import { getMDXComponents } from '@/mdx-components';
import { createRelativeLink } from 'fumadocs-ui/mdx';
import { Step, Steps } from 'fumadocs-ui/components/steps';
import { File, Folder, Files } from 'fumadocs-ui/components/files';
import { Tab, Tabs } from 'fumadocs-ui/components/tabs';

const components = {
...defaultMdxComponents,
Step,
Steps,
File,
Folder,
Files,
FileTree: Files,
Tab,
Tabs,
};
import { LLMCopyButton, ViewOptions } from '@/components/ai/page-actions';
import { gitConfig } from '@/lib/layout.shared';

export default async function Page(props: {
params: Promise<{ lang: string; slug?: string[] }>;
Expand All @@ -26,19 +17,33 @@ export default async function Page(props: {
const page = source.getPage(params.slug ?? [], params.lang);
if (!page) notFound();

const data = page.data as any;
const Content = data.body;
const MDX = page.data.body;

return (
<DocsPage toc={data.toc} full={data.full}>
<DocsPage toc={page.data.toc} full={page.data.full}>
<DocsTitle>{page.data.title}</DocsTitle>
<DocsDescription className="mb-0">{page.data.description}</DocsDescription>
<div className="flex flex-row gap-2 items-center border-b pb-6">
<LLMCopyButton markdownUrl={`${page.url}.mdx`} />
<ViewOptions
markdownUrl={`${page.url}.mdx`}
githubUrl={`https://github.com/${gitConfig.user}/${gitConfig.repo}/blob/${gitConfig.branch}/content/docs/${page.path}`}
/>
</div>
<DocsBody>
<h1 className="mb-2 text-3xl font-bold text-foreground">{page.data.title}</h1>
{page.data.description && (
<p className="mb-8 text-lg text-muted-foreground">
{page.data.description}
</p>
)}
<Content components={components} />
<MDX
components={getMDXComponents({
a: createRelativeLink(source, page),
Step,
Steps,
File,
Folder,
Files,
FileTree: Files,
Tab,
Tabs,
})}
/>
</DocsBody>
</DocsPage>
);
Expand Down
7 changes: 3 additions & 4 deletions apps/docs/app/[lang]/docs/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { source } from '@/app/source';
import type { Metadata } from 'next';
import { source } from '@/lib/source';
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
import type { ReactNode } from 'react';
import { baseOptions } from '@/app/layout.config';
import { baseOptions } from '@/lib/layout.shared';

export default async function Layout({
params,
Expand All @@ -16,7 +15,7 @@ export default async function Layout({
return (
<DocsLayout
tree={source.pageTree[lang]}
{...baseOptions}
{...baseOptions()}
i18n
>
{children}
Expand Down
26 changes: 11 additions & 15 deletions apps/docs/app/[lang]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,17 @@ export default async function LanguageLayout({
const { lang } = await params;

return (
<html lang={lang} suppressHydrationWarning>
<body>
<RootProvider
i18n={{
locale: lang,
locales: i18n.languages.map((l) => ({
name: LANGUAGE_NAMES[l] || l,
locale: l,
})),
}}
>
{children}
</RootProvider>
</body>
</html>
<RootProvider
i18n={{
locale: lang,
locales: i18n.languages.map((l) => ({
name: LANGUAGE_NAMES[l] || l,
locale: l,
})),
}}
>
{children}
</RootProvider>
);
}

Expand Down
4 changes: 2 additions & 2 deletions apps/docs/app/[lang]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Database, Monitor, HardDrive, ShieldCheck, Puzzle, Code2, Rocket, Users, Blocks, LucideIcon } from 'lucide-react';
import { HomeLayout } from 'fumadocs-ui/layouts/home';
import { baseOptions } from '@/app/layout.config';
import { baseOptions } from '@/lib/layout.shared';
import { getHomepageTranslations } from '@/lib/homepage-i18n';
import { HeroSection } from '@/components/hero-section';
import { CodePreview } from '@/components/code-preview';
Expand Down Expand Up @@ -91,7 +91,7 @@ export default async function HomePage({
];

return (
<HomeLayout {...baseOptions} i18n>
<HomeLayout {...baseOptions()} i18n>
<main className="flex min-h-screen flex-col items-center justify-center text-center px-4 py-16 sm:py-24 md:py-32 overflow-hidden bg-background text-foreground selection:bg-primary/20">

{/* Hero Section */}
Expand Down
12 changes: 4 additions & 8 deletions apps/docs/app/api/search/route.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { source } from '@/app/source';
import { createSearchAPI } from 'fumadocs-core/search/server';
import { source } from '@/lib/source';
import { createFromSource } from 'fumadocs-core/search/server';

export const { GET } = createSearchAPI('simple', {
indexes: source.getPages().map((page) => ({
title: page.data.title ?? 'Untitled',
content: page.data.description ?? '',
url: page.url,
})),
export const { GET } = createFromSource(source, {
language: 'english',
});
17 changes: 3 additions & 14 deletions apps/docs/app/global.css
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
@import "tailwindcss";
@import "fumadocs-ui/style.css";

@layer base {
:root {
--radius: 0.5rem;
}
}

@layer utilities {
.text-balance {
text-wrap: balance;
}
}
@import 'tailwindcss';
@import 'fumadocs-ui/css/neutral.css';
@import 'fumadocs-ui/css/preset.css';
47 changes: 0 additions & 47 deletions apps/docs/app/layout.config.tsx

This file was deleted.

6 changes: 1 addition & 5 deletions apps/docs/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import './global.css';
import { redirect } from 'next/navigation';
import type { ReactNode } from 'react';
import type { Metadata } from 'next';
import { i18n } from '@/lib/i18n';

export const metadata: Metadata = {
title: {
Expand All @@ -16,11 +14,9 @@ export const metadata: Metadata = {
};

export default function RootLayout({ children }: { children: ReactNode }) {
// Root layout is only used for redirects with middleware
// The actual layout is in [lang]/layout.tsx
return (
<html lang="en" suppressHydrationWarning>
<body>{children}</body>
<body className="flex flex-col min-h-screen">{children}</body>
</html>
);
}
10 changes: 10 additions & 0 deletions apps/docs/app/llms-full.txt/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { getLLMText, source } from '@/lib/source';

export const revalidate = false;

export async function GET() {
const scan = source.getPages().map(getLLMText);
const scanned = await Promise.all(scan);

return new Response(scanned.join('\n\n'));
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This endpoint returns plain text/markdown but does not set a Content-Type. Add an explicit response header (e.g. text/plain; charset=utf-8 or text/markdown; charset=utf-8) to avoid ambiguous content sniffing by clients.

Suggested change
return new Response(scanned.join('\n\n'));
return new Response(scanned.join('\n\n'), {
headers: {
'Content-Type': 'text/plain; charset=utf-8',
},
});

Copilot uses AI. Check for mistakes.
}
23 changes: 23 additions & 0 deletions apps/docs/app/llms.mdx/docs/[[...slug]]/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { getLLMText, source } from '@/lib/source';
import { notFound } from 'next/navigation';

export const revalidate = false;

export async function GET(
_req: Request,
{ params }: { params: Promise<{ slug?: string[] }> },
) {
const { slug } = await params;
Comment on lines +8 to +10
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as the OG route: params in route handlers is not a Promise. Please update the type to a plain object and drop the await to keep the handler idiomatic and easier to follow.

Suggested change
{ params }: { params: Promise<{ slug?: string[] }> },
) {
const { slug } = await params;
{ params }: { params: { slug?: string[] } },
) {
const { slug } = params;

Copilot uses AI. Check for mistakes.
const page = source.getPage(slug);
if (!page) notFound();

return new Response(await getLLMText(page), {
headers: {
'Content-Type': 'text/markdown',
},
});
}

export function generateStaticParams() {
return source.generateParams();
}
13 changes: 13 additions & 0 deletions apps/docs/app/llms.txt/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { source } from '@/lib/source';

export const revalidate = false;

export async function GET() {
const lines: string[] = [];
lines.push('# Documentation');
lines.push('');
for (const page of source.getPages()) {
lines.push(`- [${page.data.title}](${page.url}): ${page.data.description}`);
}
return new Response(lines.join('\n'));
}
33 changes: 33 additions & 0 deletions apps/docs/app/og/docs/[...slug]/route.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { getPageImage, source } from '@/lib/source';
import { notFound } from 'next/navigation';
import { ImageResponse } from 'next/og';
import { generate as DefaultImage } from 'fumadocs-ui/og';

export const revalidate = false;

export async function GET(
_req: Request,
{ params }: { params: Promise<{ slug: string[] }> },
) {
const { slug } = await params;
Comment on lines +10 to +12
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Next.js route handlers, params is already a plain object; typing it as Promise<...> and await-ing it is unnecessary and makes the handler signature misleading. Prefer { params }: { params: { slug: string[] } } and remove the await.

Suggested change
{ params }: { params: Promise<{ slug: string[] }> },
) {
const { slug } = await params;
{ params }: { params: { slug: string[] } },
) {
const { slug } = params;

Copilot uses AI. Check for mistakes.
const page = source.getPage(slug.slice(0, -1));
if (!page) notFound();

return new ImageResponse(
<DefaultImage
title={page.data.title}
description={page.data.description}
site="ObjectStack Protocol"
/>,
{
width: 1200,
height: 630,
},
);
}

export function generateStaticParams() {
return source.getPages().map((page) => ({
slug: getPageImage(page).segments,
}));
}
14 changes: 0 additions & 14 deletions apps/docs/app/source.ts

This file was deleted.

Loading
Loading