@@ -6,19 +6,14 @@ import Navbar from '@/components/home/Navbar';
66import HomeThemeFix from '@/components/home/HomeThemeFix' ;
77import GradientBlobs from '@/components/home/GradientBlobs' ;
88import FadeIn from '@/components/home/motion/FadeIn' ;
9- import { notFound } from 'next/navigation' ;
10- import { showFAQ } from '@/constants' ;
9+ import { BreadcrumbJsonLd , FAQJsonLd } from '@/components/JsonLd' ;
1110
1211export default async function FAQPage ( {
1312 params
1413} : {
1514 params : Promise < { lang ?: string } > ;
1615} ) {
1716 const { lang } = await params ;
18- if ( ! showFAQ ) {
19- notFound ( ) ;
20- }
21-
2217 const langName = lang || defaultLocale ;
2318 const dict = await getDictionary ( langName ) ;
2419
@@ -31,9 +26,21 @@ export default async function FAQPage({
3126 Answers : item . Answers . substring ( 0 , 100 ) ,
3227 } ;
3328 }
29+ const baseUrl = process . env . NEXT_PUBLIC_HOME_URL || 'https://fastgpt.io' ;
30+ const faqSchemaItems = Object . values ( faq ) . slice ( 0 , 30 ) . map ( ( item ) => ( {
31+ question : item . Question ,
32+ answer : item . Answers
33+ } ) ) ;
3434
3535 return (
3636 < div className = "home overflow-x-hidden" >
37+ < BreadcrumbJsonLd
38+ items = { [
39+ { name : dict . JsonLd . breadcrumbHome , url : `${ baseUrl } /${ langName } ` } ,
40+ { name : dict . FAQ ?. title || 'FAQ' , url : `${ baseUrl } /${ langName } /faq` }
41+ ] }
42+ />
43+ < FAQJsonLd items = { faqSchemaItems } />
3744 < HomeThemeFix />
3845 < Navbar links = { dict . links } t = { dict . Home . navCta } />
3946 < main className = "pb-[80px] px-[16px] md:px-[32px] relative" >
@@ -94,9 +101,6 @@ export default async function FAQPage({
94101}
95102
96103export async function generateStaticParams ( ) {
97- if ( ! showFAQ ) {
98- return [ ] ;
99- }
100104 return Object . keys ( localeNames ) . map ( ( lang ) => ( { lang } ) ) ;
101105}
102106
@@ -107,13 +111,6 @@ export async function generateMetadata({
107111} : {
108112 params : Promise < { lang ?: string } > ;
109113} ) {
110- if ( ! showFAQ ) {
111- return {
112- title : 'Page Not Found' ,
113- robots : { index : false , follow : false }
114- } ;
115- }
116-
117114 const { lang } = await params ;
118115 const langName = lang || defaultLocale ;
119116 const dict = await getDictionary ( langName ) ;
0 commit comments