feat: update documentation and enhance internationalization support
- Commented out the <Cards> component in index.mdx and introduction.mdx for clarity. - Added new translation entries for "homepage" and "title" in both English and Chinese message files. - Refactored layout.tsx to include a new baseOptions configuration for improved layout management and theme support. - Integrated ModeSwitcher and Logo components into the layout for enhanced user experience. - Updated page.tsx to prepare for potential Mdx component integration.
This commit is contained in:
parent
34ffcc989e
commit
88202b7cc9
@ -208,7 +208,7 @@ A link like www.example.com or https://example.com would automatically be conver
|
||||
|
||||
This works for email links too: contact@example.com.
|
||||
|
||||
<Cards>
|
||||
{/* <Cards>
|
||||
<Card title="Learn more about Next.js" href="https://nextjs.org/docs" />
|
||||
<Card title="Learn more about Fumadocs" href="https://fumadocs.vercel.app" />
|
||||
</Cards>
|
||||
</Cards> */}
|
||||
|
@ -208,7 +208,7 @@ A link like www.example.com or https://example.com would automatically be conver
|
||||
|
||||
This works for email links too: contact@example.com.
|
||||
|
||||
<Cards>
|
||||
{/* <Cards>
|
||||
<Card title="Learn more about Next.js" href="https://nextjs.org/docs" />
|
||||
<Card title="Learn more about Fumadocs" href="https://fumadocs.vercel.app" />
|
||||
</Cards>
|
||||
</Cards> */}
|
||||
|
@ -169,7 +169,9 @@
|
||||
"searchNoResult": "No results",
|
||||
"previousPage": "Previous",
|
||||
"nextPage": "Next",
|
||||
"chooseLanguage": "Select language"
|
||||
"chooseLanguage": "Select language",
|
||||
"homepage": "Homepage",
|
||||
"title": "MkSaaS Docs"
|
||||
},
|
||||
"Marketing": {
|
||||
"navbar": {
|
||||
|
@ -164,7 +164,9 @@
|
||||
"searchNoResult": "没有结果",
|
||||
"previousPage": "上一页",
|
||||
"nextPage": "下一页",
|
||||
"chooseLanguage": "选择语言"
|
||||
"chooseLanguage": "选择语言",
|
||||
"homepage": "首页",
|
||||
"title": "MkSaaS 文档"
|
||||
},
|
||||
"Marketing": {
|
||||
"navbar": {
|
||||
|
@ -11,6 +11,7 @@ import type { Metadata } from 'next';
|
||||
import { Locale } from 'next-intl';
|
||||
import { notFound } from 'next/navigation';
|
||||
import { LOCALES } from '@/i18n/routing';
|
||||
import { Mdx } from '@/components/shared/mdx-component';
|
||||
|
||||
export function generateStaticParams() {
|
||||
const locales = LOCALES;
|
||||
|
@ -7,7 +7,6 @@ import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
|
||||
|
||||
/**
|
||||
* Docs layout configurations
|
||||
*
|
||||
* https://fumadocs.vercel.app/docs/ui/layouts/docs
|
||||
*/
|
||||
export const baseOptions: BaseLayoutProps = {
|
||||
|
@ -1,13 +1,16 @@
|
||||
import { baseOptions } from '@/app/[locale]/docs/layout.config';
|
||||
import { LOCALE_LIST } from '@/i18n/routing';
|
||||
import { source } from '@/lib/docs/source';
|
||||
import { Translations } from 'fumadocs-ui/i18n';
|
||||
import { I18nProvider, Translations } from 'fumadocs-ui/i18n';
|
||||
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
|
||||
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
|
||||
import { Locale } from 'next-intl';
|
||||
import { getTranslations } from 'next-intl/server';
|
||||
import type { ReactNode } from 'react';
|
||||
import { DocsProviders } from './providers-docs';
|
||||
import { I18nProvider } from 'fumadocs-ui/i18n';
|
||||
import { LOCALE_LIST } from '@/i18n/routing';
|
||||
import { getTranslations } from 'next-intl/server';
|
||||
import { ModeSwitcher } from '@/components/layout/mode-switcher';
|
||||
import { Logo } from '@/components/logo';
|
||||
import { websiteConfig } from '@/config';
|
||||
import { docsI18nConfig } from '@/lib/docs/i18n';
|
||||
|
||||
import '@/styles/docs.css';
|
||||
|
||||
@ -38,6 +41,31 @@ export default async function DocsRootLayout({ children, params }: DocsLayoutPro
|
||||
chooseLanguage: t('chooseLanguage'),
|
||||
};
|
||||
|
||||
const baseOptions: BaseLayoutProps = {
|
||||
i18n: docsI18nConfig,
|
||||
githubUrl: websiteConfig.social.github ?? undefined,
|
||||
nav: {
|
||||
title: (
|
||||
<>
|
||||
<Logo className="size-6" />
|
||||
{t('title')}
|
||||
</>
|
||||
),
|
||||
},
|
||||
links: [
|
||||
{
|
||||
text: t('homepage'),
|
||||
url: '/',
|
||||
active: 'nested-url',
|
||||
}
|
||||
],
|
||||
themeSwitch: {
|
||||
enabled: true,
|
||||
mode: 'light-dark-system',
|
||||
component: <ModeSwitcher />
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<DocsProviders>
|
||||
<I18nProvider
|
||||
|
Loading…
Reference in New Issue
Block a user