@@ -13,14 +13,13 @@ import { PageNavigation } from '@/components/layout/PageNavigation'
1313import { MainTitle , SubTitle } from '@/components/blocks/HeadingBlock'
1414import { SEO } from '@/components/layout/SEO'
1515import { NotFound } from '@/components/layout/NotFound'
16- import { TextToSpeech } from '@/components/tts/TextToSpeech'
1716import { getAkiradocsConfig } from "@/lib/getAkiradocsConfig" ;
1817import { getTranslation } from '@/lib/staticTranslation' ;
1918import { ClientSideControls } from '@/components/layout/ClientSideControl' ;
2019import { Metadata } from 'next'
2120
22- // export const runtime = 'edge'
23- export const dynamic = 'force-static' ;
21+ export const runtime = 'edge'
22+ // export const dynamic = 'force-static';
2423
2524const PostContainer = ( { children } : { children : React . ReactNode } ) => (
2625 < div className = "flex-1 min-w-0 px-8 py-6 mx-4 font-sans leading-relaxed relative" >
@@ -36,33 +35,33 @@ type Props = {
3635 } > ;
3736}
3837
39- export async function generateStaticParams ( ) {
40- const locales = [ 'en' , 'es' , 'fr' ] ;
41- const types = [ 'docs' , 'api' , 'articles' ] ;
42- const allSlugs : { locale : string , type : string , slug : string [ ] } [ ] = [ ] ;
38+ // export async function generateStaticParams() {
39+ // const locales = ['en', 'es', 'fr'];
40+ // const types = ['docs', 'api', 'articles'];
41+ // const allSlugs: { locale: string, type: string, slug: string[] }[] = [];
4342
44- locales . forEach ( locale => {
45- types . forEach ( type => {
46- const navigationItems = getContentNavigation ( { } , locale , type ) ;
47- if ( Array . isArray ( navigationItems ) ) {
48- navigationItems . forEach ( item => {
49- if ( item . slug ) {
50- allSlugs . push ( { locale, type, slug : item . slug . split ( '/' ) } ) ;
51- }
52- } ) ;
53- }
54- } ) ;
55- } ) ;
43+ // locales.forEach(locale => {
44+ // types.forEach(type => {
45+ // const navigationItems = getContentNavigation({}, locale, type);
46+ // if (Array.isArray(navigationItems)) {
47+ // navigationItems.forEach(item => {
48+ // if (item.slug) {
49+ // allSlugs.push({ locale, type, slug: item.slug.split('/') });
50+ // }
51+ // });
52+ // }
53+ // });
54+ // });
5655
57- return allSlugs ;
58- }
56+ // return allSlugs;
57+ // }
5958
6059export async function generateMetadata ( { params } : Props ) : Promise < Metadata > {
6160 const resolvedParams = await Promise . resolve ( params ) ;
6261 const { locale, type, slug : slugArray } = resolvedParams ;
6362
6463 const slug = slugArray . length ? slugArray . join ( '/' ) : '' ;
65- const post = getContentBySlug ( locale , type , slug ) ;
64+ const post = await getContentBySlug ( locale , type , slug ) ;
6665 const t = getTranslation ( locale as 'en' | 'es' | 'fr' ) ;
6766 const akiradocsConfig = getAkiradocsConfig ( ) ;
6867
@@ -94,15 +93,14 @@ export default async function ContentPage({ params }: Props) {
9493 const t = getTranslation ( locale as 'en' | 'es' | 'de' ) ;
9594
9695 const slug = slugArray . length ? slugArray . join ( '/' ) : '' ;
97- const post = getContentBySlug ( locale , type , slug ) ;
98-
96+ const post = await getContentBySlug ( locale , type , slug ) ;
9997 if ( ! post ) {
10098 return < NotFound redirectUrl = { `/${ locale } /${ type } ` } /> ;
10199 }
102100 const akiradocsConfig = getAkiradocsConfig ( ) ;
103101 const headerConfig = getHeaderConfig ( ) ;
104102 const footerConfig = getFooterConfig ( ) ;
105- const navigationItems = getContentNavigation ( { } , locale , type ) ;
103+ const navigationItems = await getContentNavigation ( { } , locale , type ) ;
106104 const { prev, next } = getNextPrevPages ( navigationItems , `/${ type } /${ slug } ` ) ;
107105 const pageTitle = t ( post . title ) || t ( 'common.documentation' ) ;
108106 const pageDescription = t ( post . description ) || t ( 'common.documentationContent' ) ;
0 commit comments