Skip to content

Commit 8de7138

Browse files
Merge pull request #69 from heavenmei/main
中文seo
2 parents 65df45e + cafde8a commit 8de7138

File tree

5 files changed

+41
-3
lines changed

5 files changed

+41
-3
lines changed

projects/fastgpt/app/[[...lang]]/page.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import Feature from '@/components/home/Feature';
66
import Hero from '@/components/home/Hero';
77
// import SocialProof from '@/components/home/SocialProof';
88
import VideoPlayer from '@/components/home/Video';
9+
import { siteConfig, siteConfigZh } from '@/config/site';
910
import { defaultLocale, getDictionary, localeNames } from '@/lib/i18n';
11+
import { SiteConfig } from '@/types/siteConfig';
1012

1113
export default async function LangHome({ params: { lang } }: { params: { lang?: string[] } }) {
1214
let langName = lang && lang[0] && lang[0] !== 'index' ? lang[0] : defaultLocale;
@@ -58,3 +60,10 @@ export async function generateStaticParams() {
5860
const keys = Object.keys(localeNames).map((lang) => ({ lang: [lang] }));
5961
return [{ lang: [''] }, ...keys];
6062
}
63+
64+
export async function generateMetadata(
65+
{ params: { lang } }: { params: { lang?: string[] } }
66+
): Promise<SiteConfig> {
67+
let langName = lang && lang[0] && lang[0] !== 'index' ? lang[0] : defaultLocale;
68+
return langName === 'zh' ? siteConfigZh : siteConfig;
69+
}

projects/fastgpt/components/header/LangSwitcher.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ export const LangSwitcher = () => {
2020

2121
const handleSwitchLanguage = (value: string) => {
2222
localStorage.setItem('preferredLang', value);
23-
if (value === defaultLocale) {
23+
if (value === 'zh') {
24+
router.push('https://fastgpt.cn/');
25+
return;
26+
}else if (value === defaultLocale) {
2427
router.push('/');
2528
return;
2629
}
@@ -29,7 +32,7 @@ export const LangSwitcher = () => {
2932

3033
useEffect(() => {
3134
const storedLang = localStorage.getItem('preferredLang');
32-
if (storedLang && storedLang !== lang) {
35+
if (storedLang && storedLang !== lang && storedLang !== defaultLocale) {
3336
router.push(storedLang);
3437
}
3538
}, []);

projects/fastgpt/components/home/Hero.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const Hero = ({ locale, CTALocale, stars }: { locale: any; CTALocale: any; stars
2828
border: '1px solid rgba(179, 220, 229, 0.40)',
2929
}}
3030
>
31-
<span style={{ color: '#F8A3FF' }}>9w+&nbsp;</span>
31+
<span style={{ color: '#F8A3FF' }}>20w+&nbsp;</span>
3232
{locale.maker}
3333
</div>
3434

projects/fastgpt/config/site.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { MdEmail } from 'react-icons/md';
66
const OPEN_SOURCE_URL = 'https://github.com/labring/FastGPT';
77

88
const baseSiteConfig = {
9+
title: 'FastGPT',
910
name: 'FastGPT',
1011
description:
1112
'A free, open-source, and powerful AI knowledge base platform, offers out-of-the-box data processing, model invocation, RAG retrieval, and visual AI workflows. Easily build complex Q&A systems.',
@@ -98,3 +99,27 @@ export const siteConfig: SiteConfig = {
9899
creator: baseSiteConfig.creator
99100
}
100101
};
102+
103+
export const siteConfigZh: SiteConfig = {
104+
...siteConfig,
105+
title: 'FastGPT - 企业级智能AI模型问答知识库',
106+
description:'FastGPT是一个基于 LLM 大语言模型的知识库问答系统,提供开箱即用的数据处理、模型调用等能力.同时可以通过 Flow 可视化进行工作流编排,从而实现复杂的问答场景!',
107+
keywords: [
108+
'FastGPT',
109+
'free',
110+
'知识库',
111+
'问答',
112+
'数据处理',
113+
'模型调用',
114+
'RAG检索',
115+
'可视化AI工作流',
116+
'企业知识库',
117+
'rag',
118+
'ai',
119+
'workflow',
120+
'llm',
121+
'gpt',
122+
'gpt4',
123+
'orchestration',
124+
],
125+
};

projects/fastgpt/types/siteConfig.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export type ThemeColor = {
1919
color: string;
2020
};
2121
export type SiteConfig = {
22+
title: string;
2223
name: string;
2324
description: string;
2425
url: string;

0 commit comments

Comments
 (0)