@@ -6,11 +6,9 @@ import { createAPIPage } from 'fumadocs-openapi/ui'
66import { Pre } from 'fumadocs-ui/components/codeblock'
77import defaultMdxComponents from 'fumadocs-ui/mdx'
88import { DocsBody , DocsDescription , DocsPage , DocsTitle } from 'fumadocs-ui/page'
9- import { ChevronLeft , ChevronRight } from 'lucide-react'
10- import Link from 'next/link'
119import { notFound } from 'next/navigation'
10+ import { PageFooter } from '@/components/docs-layout/page-footer'
1211import { PageNavigationArrows } from '@/components/docs-layout/page-navigation-arrows'
13- import { TOCFooter } from '@/components/docs-layout/toc-footer'
1412import { LLMCopyButton } from '@/components/page-actions'
1513import { StructuredData } from '@/components/structured-data'
1614import { CodeBlock } from '@/components/ui/code-block'
@@ -23,6 +21,15 @@ import { type PageData, source } from '@/lib/source'
2321const SUPPORTED_LANGUAGES : Set < string > = new Set ( i18n . languages )
2422const BASE_URL = 'https://docs.sim.ai'
2523
24+ const OG_LOCALE_MAP : Record < string , string > = {
25+ en : 'en_US' ,
26+ es : 'es_ES' ,
27+ fr : 'fr_FR' ,
28+ de : 'de_DE' ,
29+ ja : 'ja_JP' ,
30+ zh : 'zh_CN' ,
31+ }
32+
2633function resolveLangAndSlug ( params : { slug ?: string [ ] ; lang : string } ) {
2734 const isValidLang = SUPPORTED_LANGUAGES . has ( params . lang )
2835 const lang = isValidLang ? params . lang : 'en'
@@ -120,101 +127,7 @@ export default async function Page(props: { params: Promise<{ slug?: string[]; l
120127 }
121128
122129 const breadcrumbs = generateBreadcrumbs ( )
123-
124- const CustomFooter = ( ) => (
125- < div className = 'mt-12' >
126- < div className = 'flex items-center justify-between py-8' >
127- { neighbours ?. previous ? (
128- < Link
129- href = { neighbours . previous . url }
130- className = 'group flex items-center gap-2 text-muted-foreground transition-colors hover:text-foreground'
131- >
132- < ChevronLeft className = 'group-hover:-translate-x-1 h-4 w-4 transition-transform' />
133- < span className = 'font-medium' > { neighbours . previous . name } </ span >
134- </ Link >
135- ) : (
136- < div />
137- ) }
138-
139- { neighbours ?. next ? (
140- < Link
141- href = { neighbours . next . url }
142- className = 'group flex items-center gap-2 text-muted-foreground transition-colors hover:text-foreground'
143- >
144- < span className = 'font-medium' > { neighbours . next . name } </ span >
145- < ChevronRight className = 'h-4 w-4 transition-transform group-hover:translate-x-1' />
146- </ Link >
147- ) : (
148- < div />
149- ) }
150- </ div >
151-
152- < div className = 'border-border border-t' />
153-
154- < div className = 'flex items-center gap-4 py-6' >
155- < Link
156- href = 'https://x.com/simdotai'
157- target = '_blank'
158- rel = 'noopener noreferrer'
159- aria-label = 'X (Twitter)'
160- >
161- < div
162- className = 'h-5 w-5 bg-gray-400 transition-colors hover:bg-gray-500 dark:bg-gray-500 dark:hover:bg-gray-400'
163- style = { {
164- maskImage :
165- "url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z%22/%3E%3C/svg%3E')" ,
166- maskRepeat : 'no-repeat' ,
167- maskPosition : 'center center' ,
168- WebkitMaskImage :
169- "url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z%22/%3E%3C/svg%3E')" ,
170- WebkitMaskRepeat : 'no-repeat' ,
171- WebkitMaskPosition : 'center center' ,
172- } }
173- />
174- </ Link >
175- < Link
176- href = 'https://github.com/simstudioai/sim'
177- target = '_blank'
178- rel = 'noopener noreferrer'
179- aria-label = 'GitHub'
180- >
181- < div
182- className = 'h-5 w-5 bg-gray-400 transition-colors hover:bg-gray-500 dark:bg-gray-500 dark:hover:bg-gray-400'
183- style = { {
184- maskImage :
185- "url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z%22/%3E%3C/svg%3E')" ,
186- maskRepeat : 'no-repeat' ,
187- maskPosition : 'center center' ,
188- WebkitMaskImage :
189- "url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z%22/%3E%3C/svg%3E')" ,
190- WebkitMaskRepeat : 'no-repeat' ,
191- WebkitMaskPosition : 'center center' ,
192- } }
193- />
194- </ Link >
195- < Link
196- href = 'https://discord.gg/Hr4UWYEcTT'
197- target = '_blank'
198- rel = 'noopener noreferrer'
199- aria-label = 'Discord'
200- >
201- < div
202- className = 'h-5 w-5 bg-gray-400 transition-colors hover:bg-gray-500 dark:bg-gray-500 dark:hover:bg-gray-400'
203- style = { {
204- maskImage :
205- "url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515a.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0a12.64 12.64 0 0 0-.617-1.25a.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057a19.9 19.9 0 0 0 5.993 3.03a.078.078 0 0 0 .084-.028a14.09 14.09 0 0 0 1.226-1.994a.076.076 0 0 0-.041-.106a13.107 13.107 0 0 1-1.872-.892a.077.077 0 0 1-.008-.128a10.2 10.2 0 0 0 .372-.292a.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127a12.299 12.299 0 0 1-1.873.892a.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028a19.839 19.839 0 0 0 6.002-3.03a.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419c0-1.333.956-2.419 2.157-2.419c1.21 0 2.176 1.096 2.157 2.42c0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419c0-1.333.955-2.419 2.157-2.419c1.21 0 2.176 1.096 2.157 2.42c0 1.333-.946 2.418-2.157 2.418z%22/%3E%3C/svg%3E')" ,
206- maskRepeat : 'no-repeat' ,
207- maskPosition : 'center center' ,
208- WebkitMaskImage :
209- "url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515a.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0a12.64 12.64 0 0 0-.617-1.25a.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057a19.9 19.9 0 0 0 5.993 3.03a.078.078 0 0 0 .084-.028a14.09 14.09 0 0 0 1.226-1.994a.076.076 0 0 0-.041-.106a13.107 13.107 0 0 1-1.872-.892a.077.077 0 0 1-.008-.128a10.2 10.2 0 0 0 .372-.292a.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127a12.299 12.299 0 0 1-1.873.892a.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028a19.839 19.839 0 0 0 6.002-3.03a.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419c0-1.333.956-2.419 2.157-2.419c1.21 0 2.176 1.096 2.157 2.42c0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419c0-1.333.955-2.419 2.157-2.419c1.21 0 2.176 1.096 2.157 2.42c0 1.333-.946 2.418-2.157 2.418z%22/%3E%3C/svg%3E')" ,
210- WebkitMaskRepeat : 'no-repeat' ,
211- WebkitMaskPosition : 'center center' ,
212- } }
213- />
214- </ Link >
215- </ div >
216- </ div >
217- )
130+ const footer = < PageFooter previous = { neighbours ?. previous } next = { neighbours ?. next } />
218131
219132 if ( isOpenAPI && data . getAPIPageProps ) {
220133 const apiProps = data . getAPIPageProps ( )
@@ -233,7 +146,6 @@ export default async function Page(props: { params: Promise<{ slug?: string[]; l
233146 lang = { lang }
234147 breadcrumb = { breadcrumbs }
235148 />
236- < style > { `#nd-page { grid-column: main-start / toc-end !important; max-width: 1400px !important; }` } </ style >
237149 < DocsPage
238150 toc = { data . toc }
239151 breadcrumb = { {
@@ -249,7 +161,7 @@ export default async function Page(props: { params: Promise<{ slug?: string[]; l
249161 } }
250162 footer = { {
251163 enabled : true ,
252- component : < CustomFooter /> ,
164+ component : footer ,
253165 } }
254166 >
255167 < div className = 'api-page-header relative mt-6 sm:mt-0' >
@@ -259,7 +171,7 @@ export default async function Page(props: { params: Promise<{ slug?: string[]; l
259171 </ div >
260172 < PageNavigationArrows previous = { neighbours ?. previous } next = { neighbours ?. next } />
261173 </ div >
262- < DocsTitle > { data . title } </ DocsTitle >
174+ < DocsTitle className = 'mb-2' > { data . title } </ DocsTitle >
263175 < DocsDescription > { data . description } </ DocsDescription >
264176 </ div >
265177 < DocsBody >
@@ -291,7 +203,6 @@ export default async function Page(props: { params: Promise<{ slug?: string[]; l
291203 tableOfContent = { {
292204 style : 'clerk' ,
293205 enabled : true ,
294- footer : < TOCFooter /> ,
295206 single : false ,
296207 } }
297208 tableOfContentPopover = { {
@@ -300,7 +211,7 @@ export default async function Page(props: { params: Promise<{ slug?: string[]; l
300211 } }
301212 footer = { {
302213 enabled : true ,
303- component : < CustomFooter /> ,
214+ component : footer ,
304215 } }
305216 >
306217 < div className = 'relative mt-6 sm:mt-0' >
@@ -310,7 +221,7 @@ export default async function Page(props: { params: Promise<{ slug?: string[]; l
310221 </ div >
311222 < PageNavigationArrows previous = { neighbours ?. previous } next = { neighbours ?. next } />
312223 </ div >
313- < DocsTitle > { data . title } </ DocsTitle >
224+ < DocsTitle className = 'mb-2' > { data . title } </ DocsTitle >
314225 < DocsDescription > { data . description } </ DocsDescription >
315226 </ div >
316227 < DocsBody >
@@ -393,10 +304,10 @@ export async function generateMetadata(props: {
393304 url : fullUrl ,
394305 siteName : 'Sim Documentation' ,
395306 type : 'article' ,
396- locale : lang === 'en' ? 'en_US' : ` ${ lang } _ ${ lang . toUpperCase ( ) } ` ,
397- alternateLocale : [ 'en' , 'es' , 'fr' , 'de' , 'ja' , 'zh' ]
307+ locale : OG_LOCALE_MAP [ lang ] ?? 'en_US' ,
308+ alternateLocale : i18n . languages
398309 . filter ( ( l ) => l !== lang )
399- . map ( ( l ) => ( l === 'en' ? 'en_US' : ` ${ l } _ ${ l . toUpperCase ( ) } ` ) ) ,
310+ . map ( ( l ) => OG_LOCALE_MAP [ l ] ?? 'en_US' ) ,
400311 images : [
401312 {
402313 url : ogImageUrl ,
@@ -416,17 +327,6 @@ export async function generateMetadata(props: {
416327 creator : '@simdotai' ,
417328 site : '@simdotai' ,
418329 } ,
419- robots : {
420- index : true ,
421- follow : true ,
422- googleBot : {
423- index : true ,
424- follow : true ,
425- 'max-video-preview' : - 1 ,
426- 'max-image-preview' : 'large' ,
427- 'max-snippet' : - 1 ,
428- } ,
429- } ,
430330 canonical : fullUrl ,
431331 alternates : {
432332 canonical : fullUrl ,
0 commit comments