mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-18 17:51:24 +00:00
New document (#5299)
* add new doc (#5175) Co-authored-by: dreamer6680 <146868355@qq.com> * Test docs (#5235) * fix: change the page of doc * chore: add new dependencies, update global styles/layout, optimize docs, add Feishu & GitHub icons, update API examples * fix: docs/index 404 not found * Update environment variable names, optimize styles, add new API routes, fix component styles, adjust documentation, and update GitHub and Feishu icons * update readme * feat: add a linkfastgpt compontent * feat: update new doc * fix:remove unuse page and redirect homepage to docs (#5288) * fix:remove some unuse doc * fix: redirect homepage to doc * git ignore * fix:navbar to index (#5295) * sidbar * fix: navtab unlight (#5298) * doc --------- Co-authored-by: dreamer6680 <1468683855@qq.com> Co-authored-by: dreamer6680 <146868355@qq.com>
This commit is contained in:
79
document/app/[lang]/layout.tsx
Normal file
79
document/app/[lang]/layout.tsx
Normal file
@@ -0,0 +1,79 @@
|
||||
import '@/app/global.css';
|
||||
import { RootProvider } from 'fumadocs-ui/provider';
|
||||
import { Inter } from 'next/font/google';
|
||||
import type { ReactNode } from 'react';
|
||||
import type { Translations } from 'fumadocs-ui/i18n';
|
||||
import CustomSearchDialog from '@/components/CustomSearchDialog';
|
||||
|
||||
const inter = Inter({
|
||||
subsets: ['latin']
|
||||
});
|
||||
|
||||
const zh_CN: Partial<Translations> = {
|
||||
search: '搜索',
|
||||
nextPage: '下一页',
|
||||
previousPage: '上一页',
|
||||
lastUpdate: '最后更新于',
|
||||
editOnGithub: '在 GitHub 上编辑',
|
||||
searchNoResult: '没有找到相关内容',
|
||||
toc: '本页导航',
|
||||
tocNoHeadings: '本页没有导航',
|
||||
chooseLanguage: '选择语言'
|
||||
};
|
||||
|
||||
const locales = [
|
||||
{
|
||||
name: 'English',
|
||||
locale: 'en'
|
||||
},
|
||||
{
|
||||
name: '简体中文',
|
||||
locale: 'zh-CN'
|
||||
}
|
||||
];
|
||||
|
||||
export default async function Layout({
|
||||
children,
|
||||
params
|
||||
}: {
|
||||
children: ReactNode;
|
||||
params: Promise<{ lang: string }>;
|
||||
}) {
|
||||
const { lang } = await params;
|
||||
|
||||
return (
|
||||
<html lang={lang} className={inter.className} suppressHydrationWarning>
|
||||
<body className="flex flex-col min-h-screen">
|
||||
<RootProvider
|
||||
i18n={{
|
||||
locale: lang,
|
||||
locales,
|
||||
translations: {
|
||||
'zh-CN': zh_CN,
|
||||
en: {
|
||||
search: 'Search',
|
||||
nextPage: 'Next Page',
|
||||
previousPage: 'Previous Page',
|
||||
lastUpdate: 'Last Updated',
|
||||
editOnGithub: 'Edit on GitHub',
|
||||
searchNoResult: 'No results found',
|
||||
toc: 'On this page',
|
||||
tocNoHeadings: 'No headings',
|
||||
chooseLanguage: 'Choose Language'
|
||||
}
|
||||
}[lang]
|
||||
}}
|
||||
search={{
|
||||
enabled: true,
|
||||
SearchDialog: CustomSearchDialog
|
||||
}}
|
||||
theme={{
|
||||
enabled: true
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</RootProvider>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user