Files
librechat.ai/app/docs/[[...slug]]/page.tsx
Marco Beretta e3ad59744d feat: redesign docs site pages, migrate legal/about to App Router, add feedback widget (#502)
* feat: update table of content style in DocsPage component

* feat: add feedback widget, redesign DocsHub, and add sidebar logo

* feat: update demo images for dark and light themes

* feat: update demo images for dark and light themes

* feat: replace logo image and remove duplicate SVG file

* feat: add LocalInstallHub component and update documentation for local installation

* feat: enhance UI by updating feature icons and descriptions, and improving layout responsiveness

* Add legal pages: Cookie Policy, Privacy Policy, and Terms of Service

- Implemented Cookie Policy page with details on cookie usage and user privacy.
- Created Privacy Policy page outlining data collection practices and user rights.
- Developed Terms of Service page defining the usage terms for the documentation site.
- Removed outdated MDX files for cookie, privacy, and terms of service.
- Updated FeaturesHub component to include new feature highlights and improved layout.

* feat: enhance GitHub data fetching to include contributor count and update CommunitySection layout
2026-02-19 00:06:58 +01:00

65 lines
1.8 KiB
TypeScript

import { docsSource } from '@/lib/source'
import { mdxComponents } from '@/lib/mdx-components'
import { DocsPage, DocsBody, DocsTitle, DocsDescription } from 'fumadocs-ui/page'
import { notFound } from 'next/navigation'
import { LLMCopyButton, ViewOptions } from '@/components/page-actions'
import { Feedback } from '@/components/Feedback'
import type { Metadata } from 'next'
interface PageProps {
params: Promise<{ slug?: string[] }>
}
export default async function Page(props: PageProps) {
const params = await props.params
const page = docsSource.getPage(params.slug)
if (!page) notFound()
const MDX = page.data.body
return (
<DocsPage
toc={page.data.toc}
tableOfContent={{ style: 'clerk' }}
lastUpdate={page.data.lastModified}
editOnGithub={{
owner: 'LibreChat-AI',
repo: 'librechat.ai',
sha: 'main',
path: `content/docs/${page.file.path}`,
}}
>
<DocsTitle>{page.data.title}</DocsTitle>
<DocsDescription>{page.data.description}</DocsDescription>
<div className="flex flex-row gap-2 items-center border-b pt-2 pb-6">
<LLMCopyButton markdownUrl={`${page.url}.mdx`} />
<ViewOptions markdownUrl={`${page.url}.mdx`} />
</div>
<DocsBody>
<MDX components={mdxComponents} />
</DocsBody>
<Feedback />
</DocsPage>
)
}
export async function generateStaticParams() {
return docsSource.generateParams()
}
export async function generateMetadata(props: PageProps): Promise<Metadata> {
const params = await props.params
const page = docsSource.getPage(params.slug)
if (!page) notFound()
return {
title: page.data.title,
description: page.data.description,
openGraph: {
title: page.data.title,
description: page.data.description,
type: 'article',
},
}
}