This repository has been archived by the owner on Oct 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
theme.config.tsx
189 lines (184 loc) · 5.95 KB
/
theme.config.tsx
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
import React, { Fragment } from 'react'
import { useConfig, DocsThemeConfig } from 'nextra-theme-docs'
import LogoMark from '@/components/LogoMark'
import FooterMenu from '@/components/FooterMenu'
import JSONLD from '@/components/JSONLD'
import { useRouter } from 'next/router'
import Link from 'next/link'
import { LibraryBig, Blocks, BrainCircuit, Computer } from 'lucide-react'
import { AiOutlineGithub } from 'react-icons/ai'
import { BiLogoDiscordAlt } from 'react-icons/bi'
import { RiTwitterXFill } from 'react-icons/ri'
const defaultUrl = 'https://jan.ai'
const defaultImage = 'https://jan.ai/assets/images/general/og-image.png'
const structuredData = {
'@context': 'https://schema.org',
'@type': 'Organization',
'name': 'Jan',
'url': `${defaultUrl}`,
'logo': `${defaultImage}`,
}
const config: DocsThemeConfig = {
logo: (
<span className="flex gap-x-8 items-center">
<div className="flex">
<LogoMark />
<span className="ml-2 text-lg font-semibold">Jan</span>
</div>
</span>
),
docsRepositoryBase: 'https://github.com/janhq/docs/tree/main',
feedback: {
content: 'Question? Give us feedback →',
labels: 'feedback',
},
editLink: {
text: 'Edit this page on GitHub →',
},
useNextSeoProps() {
return {
titleTemplate: '%s - Jan',
twitter: {
cardType: 'summary_large_image',
site: '@jandotai',
},
openGraph: {
type: 'website',
},
}
},
navbar: {
extraContent: (
<div className="inline-flex items-center gap-x-2">
<a href="https://discord.com/invite/FTk2MvZwJH" target="_blank">
<BiLogoDiscordAlt className="text-xl text-black/60 dark:text-white/60" />
</a>
<a href="https://twitter.com/jandotai" target="_blank">
<RiTwitterXFill className="text-lg text-black/60 dark:text-white/60" />
</a>
<a href="https://github.com/janhq/jan" target="_blank">
<AiOutlineGithub className="text-xl text-black/60 dark:text-white/60" />
</a>
</div>
),
},
sidebar: {
titleComponent: ({ type, title }) => {
// eslint-disable-next-line react-hooks/rules-of-hooks
const { asPath } = useRouter()
if (type === 'separator' && title === 'Switcher') {
return (
<div className="-mx-2 hidden md:block">
{[
{ title: 'Jan', path: '/docs', Icon: LibraryBig },
{
title: 'Cortex',
path: 'https://cortex.so/docs/',
Icon: BrainCircuit,
},
{ title: 'Integrations', path: '/integrations', Icon: Blocks },
].map((item) =>
asPath.startsWith(item.path) ? (
<div
key={item.path}
className="group mb-3 flex flex-row items-center gap-3 nx-text-primary-800 dark:nx-text-primary-600"
>
<item.Icon className="w-7 h-7 p-1 border border-gray-200 dark:border-gray-700 rounded nx-bg-primary-100 dark:nx-bg-primary-400/10" />
{item.title}
</div>
) : (
<Link
href={item.path}
key={item.path}
className="group mb-3 flex flex-row items-center gap-3 text-gray-500 hover:text-primary/100"
>
<item.Icon className="w-7 h-7 p-1 border rounded border-gray-200 dark:border-gray-700" />
{item.title}
</Link>
)
)}
</div>
)
}
return title
},
defaultMenuCollapseLevel: 1,
toggleButton: true,
},
toc: {
backToTop: true,
},
head: function useHead() {
const { title, frontMatter } = useConfig()
const titleTemplate = (frontMatter?.title || title) + ' - ' + 'Jan'
const { asPath } = useRouter()
return (
<Fragment>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta httpEquiv="Content-Language" content="en" />
<title>{titleTemplate}</title>
<meta name="og:title" content={titleTemplate} />
<meta
name="description"
content={
frontMatter?.description ||
`Run LLMs like Mistral or Llama2 locally and offline on your computer, or connect to remote AI APIs like OpenAI’s GPT-4 or Groq.`
}
/>
<meta
name="og:description"
content={
frontMatter?.description ||
`Run LLMs like Mistral or Llama2 locally and offline on your computer, or connect to remote AI APIs like OpenAI’s GPT-4 or Groq.`
}
/>
<link
rel="canonical"
href={frontMatter?.ogImage ? 'https://jan.ai' + asPath : defaultUrl}
/>
<meta
property="og:url"
content={
frontMatter?.ogImage ? 'https://jan.ai' + asPath : defaultUrl
}
/>
<meta
property="og:image"
content={
frontMatter?.ogImage
? 'https://jan.ai/' + frontMatter?.ogImage
: 'https://jan.ai/assets/images/general/og-image.png'
}
/>
<meta property="og:image:alt" content="Jan-OGImage" />
<meta
name="keywords"
content={
frontMatter?.keywords?.map((keyword: string) => keyword) || [
'Jan',
'Customizable Intelligence, LLM',
'local AI',
'privacy focus',
'free and open source',
'private and offline',
'conversational AI',
'no-subscription fee',
'large language models',
'build in public',
'remote team',
'how we work',
]
}
/>
<JSONLD data={structuredData} />
</Fragment>
)
},
footer: {
text: <FooterMenu />,
},
nextThemes: {
defaultTheme: 'light',
},
}
export default config