-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlayout.shared.tsx
More file actions
70 lines (64 loc) · 2.11 KB
/
Copy pathlayout.shared.tsx
File metadata and controls
70 lines (64 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
import Image from 'next/image';
export const gitConfig = {
user: 'objectstack-ai',
repo: 'objectos',
branch: 'main',
};
const NAV_LABELS: Record<string, { docs: string; blog: string; download: string; changelog: string }> = {
en: { docs: 'Docs', blog: 'Blog', download: 'Download', changelog: 'Changelog' },
'zh-Hans': { docs: '文档', blog: '博客', download: '下载', changelog: '更新日志' },
ja: { docs: 'ドキュメント', blog: 'ブログ', download: 'ダウンロード', changelog: '変更履歴' },
de: { docs: 'Dokumentation', blog: 'Blog', download: 'Download', changelog: 'Änderungen' },
es: { docs: 'Documentación', blog: 'Blog', download: 'Descargar', changelog: 'Cambios' },
fr: { docs: 'Documentation', blog: 'Blog', download: 'Télécharger', changelog: 'Journal' },
ko: { docs: '문서', blog: '블로그', download: '다운로드', changelog: '변경 내역' },
};
const RELEASES_URL = 'https://github.com/objectstack-ai/objectos/releases';
function localePrefix(lang: string): string {
return lang === 'en' ? '' : `/${lang}`;
}
export function baseOptions(lang: string = 'en'): BaseLayoutProps {
const labels = NAV_LABELS[lang] ?? NAV_LABELS.en;
const prefix = localePrefix(lang);
return {
nav: {
title: (
<div className="flex items-center gap-2 font-bold">
<Image
src="/logo.svg"
alt=""
aria-hidden="true"
width={30}
height={30}
/>
ObjectOS
</div>
),
transparentMode: 'top',
},
links: [
{
text: labels.docs,
url: `${prefix}/docs`,
active: 'nested-url',
},
{
text: labels.blog,
url: `${prefix}/blog`,
active: 'nested-url',
},
{
text: labels.download,
url: `${prefix}/download`,
active: 'nested-url',
},
{
text: labels.changelog,
url: RELEASES_URL,
external: true,
},
],
githubUrl: `https://github.com/${gitConfig.user}/${gitConfig.repo}`,
};
}