mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-10-08 07:21:13 +08:00
feat(docs): enhance documentation site with internationalization and layout updates
- Updated the demo API to support locale-based content rendering. - Refactored the main layout to accommodate language-specific metadata and routing. - Introduced new components for blog and documentation pages, ensuring proper language handling. - Added styles for improved UI consistency across different sections. - Removed deprecated layout files and streamlined the structure for better maintainability.
This commit is contained in:
@@ -1,27 +1,35 @@
|
||||
import { zhCN } from '@fumadocs/language/zh-cn';
|
||||
import { defineTranslations } from 'fumadocs-core/i18n';
|
||||
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
|
||||
import { uiTranslations } from 'fumadocs-ui/i18n';
|
||||
import { i18n, type Language } from './i18n';
|
||||
import { appName, gitConfig, releaseUrl } from './shared';
|
||||
|
||||
export const translations = defineTranslations().extend(uiTranslations()).preset(zhCN());
|
||||
export const translations = i18n.translations().extend(uiTranslations()).preset('zh', zhCN());
|
||||
|
||||
const navLabels: Record<Language, { docs: string; blog: string; download: string }> = {
|
||||
zh: { docs: '文档', blog: '开发者博客', download: '下载' },
|
||||
en: { docs: 'Docs', blog: 'Blog', download: 'Download' },
|
||||
};
|
||||
|
||||
export function baseOptions(lang: Language): BaseLayoutProps {
|
||||
const labels = navLabels[lang];
|
||||
const prefix = lang === i18n.defaultLanguage ? '' : `/${lang}`;
|
||||
|
||||
export function baseOptions(): BaseLayoutProps {
|
||||
return {
|
||||
nav: {
|
||||
title: appName,
|
||||
},
|
||||
links: [
|
||||
{
|
||||
text: '文档',
|
||||
url: '/docs',
|
||||
text: labels.docs,
|
||||
url: `${prefix}/docs`,
|
||||
},
|
||||
{
|
||||
text: '开发者博客',
|
||||
url: '/blog',
|
||||
text: labels.blog,
|
||||
url: `${prefix}/blog`,
|
||||
},
|
||||
{
|
||||
text: '下载',
|
||||
text: labels.download,
|
||||
url: releaseUrl,
|
||||
external: true,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user