-
Notifications
You must be signed in to change notification settings - Fork 0
Update fumadocs template to v16.5.1 with i18n and LLM support #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| @import 'tailwindcss'; | ||
| @import 'fumadocs-ui/css/neutral.css'; | ||
| @import 'fumadocs-ui/css/preset.css'; |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| /** | ||
| * ObjectDocs | ||
| * Copyright (c) 2026-present ObjectStack Inc. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| */ | ||
|
|
||
| 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')); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| /** | ||
| * ObjectDocs | ||
| * Copyright (c) 2026-present ObjectStack Inc. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| */ | ||
|
|
||
| import { getLLMText, source } from '@/lib/source'; | ||
| import { notFound } from 'next/navigation'; | ||
|
|
||
| export const revalidate = false; | ||
|
|
||
| export async function GET(_req: Request, { params }: RouteContext<'/llms.mdx/docs/[[...slug]]'>) { | ||
| const { slug } = await params; | ||
| 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(); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| /** | ||
| * ObjectDocs | ||
| * Copyright (c) 2026-present ObjectStack Inc. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| */ | ||
|
|
||
| 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')); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /** | ||
| * ObjectDocs | ||
| * Copyright (c) 2026-present ObjectStack Inc. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| */ | ||
|
|
||
| import { getPageImage, source } from '@/lib/source'; | ||
| import { notFound } from 'next/navigation'; | ||
| import { ImageResponse } from 'next/og'; | ||
| import { generate as DefaultImage } from 'fumadocs-ui/og'; | ||
| import { siteConfig } from '@/lib/site-config'; | ||
|
|
||
| export const revalidate = false; | ||
|
|
||
| export async function GET(_req: Request, { params }: RouteContext<'/og/docs/[...slug]'>) { | ||
| const { slug } = await params; | ||
|
Comment on lines
+17
to
+18
|
||
| const page = source.getPage(slug.slice(0, -1)); | ||
| if (!page) notFound(); | ||
|
Comment on lines
+18
to
+20
|
||
|
|
||
| return new ImageResponse( | ||
| <DefaultImage title={page.data.title} description={page.data.description} site={siteConfig.meta.title} />, | ||
| { | ||
| width: 1200, | ||
| height: 630, | ||
| }, | ||
| ); | ||
| } | ||
|
|
||
| export function generateStaticParams() { | ||
| return source.getPages().map((page) => ({ | ||
| lang: page.locale, | ||
| slug: getPageImage(page).segments, | ||
| })); | ||
|
Comment on lines
+31
to
+35
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RouteContextis referenced in the GET handler signature but is not defined/imported anywhere in the repo, which will cause a TypeScript compile error. Replace it with an explicit context type forparams(or import the correct Next-generated type if available).