feat(docs): enhance documentation and UI consistency

- Updated the index.html to dynamically set the theme color based on user selection, improving user experience during theme switching.
- Modified proxy.ts to include 'icon.png' in the matcher for better asset handling.
- Added a new icon.png file for enhanced branding.
- Improved metadata in layout.tsx and page.tsx files for better clarity and consistency in documentation.
- Updated various documentation files to reflect the new branding of 'Cursor Byok' and ensure consistent terminology throughout.
- Removed outdated blog entries and added new content to better align with the current product direction.
This commit is contained in:
leookun
2026-08-28 01:33:51 +08:00
parent 2b54014cf9
commit 217f984112
27 changed files with 314 additions and 136 deletions
+2 -1
View File
@@ -3,7 +3,8 @@ import { defineI18n } from 'fumadocs-core/i18n';
export const i18n = defineI18n({
defaultLanguage: 'zh',
languages: ['zh', 'en'],
hideLocale: 'default-locale',
// 所有语言显式带前缀;未带前缀的访问由中间件按浏览器 Accept-Language 协商后重定向
hideLocale: 'never',
});
export type Language = (typeof i18n)['languages'][number];
+8 -2
View File
@@ -1,3 +1,4 @@
import Image from 'next/image';
import { zhCN } from '@fumadocs/language/zh-cn';
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
import { uiTranslations } from 'fumadocs-ui/i18n';
@@ -13,11 +14,16 @@ const navLabels: Record<Language, { docs: string; blog: string; download: string
export function baseOptions(lang: Language): BaseLayoutProps {
const labels = navLabels[lang];
const prefix = lang === i18n.defaultLanguage ? '' : `/${lang}`;
const prefix = `/${lang}`;
return {
nav: {
title: appName,
title: (
<>
<Image src="/images/logo.png" alt="" width={20} height={20} className="rounded-[5px]" />
{appName}
</>
),
},
links: [
{
+1 -1
View File
@@ -1,4 +1,4 @@
export const appName = 'cursor-byok';
export const appName = 'Cursor Byok';
export const appDescription = 'Cursor 服务端的开源替代';
export const docsRoute = '/docs';
export const docsImageRoute = '/og/docs';
+2 -2
View File
@@ -26,9 +26,9 @@ export const source = loader({
i18n,
});
/** Locale URL prefix segment; empty for the default (hidden) locale. */
/** Locale URL prefix segment; all locales are explicit (hideLocale: 'never'). */
function localeSegment(page: (typeof source)['$inferPage']): string | undefined {
return page.locale === i18n.defaultLanguage ? undefined : page.locale;
return page.locale;
}
export function getPageImageUrl(page: (typeof source)['$inferPage']) {