forked from LibreChat-AI/librechat.ai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
theme.config.tsx
127 lines (116 loc) · 4.2 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
import React from 'react'
import Link from 'next/link'
import { useRouter } from 'next/router'
import { GeistSans } from 'geist/font/sans'
import { DocsThemeConfig, useConfig, ThemeSwitch } from 'nextra-theme-docs'
import { Steps, Tabs, Cards, FileTree, Button } from 'nextra/components'
import { Callout } from '@/components/callouts/callout'
import Carousel from '@/components/carousel/Carousel'
import { Logo } from '@/components/logo'
import { Frame } from './components/Frame'
import { OptionTable } from 'components/table'
import FooterMenu from './components/FooterMenu'
const config: DocsThemeConfig = {
logo: <Logo />,
logoLink: '/',
project: {
link: 'https://github.com/danny-avila/LibreChat',
},
chat: {
link: 'https://discord.librechat.ai',
},
search: {
placeholder: 'Search...',
},
navbar: {
extraContent: () => {
return <>{ThemeSwitch({ lite: true, className: 'button-switch theme-switch' })}</>
},
},
sidebar: {
defaultMenuCollapseLevel: 1,
toggleButton: true,
},
editLink: {
content: 'Edit this page on GitHub',
},
toc: {
backToTop: true,
},
docsRepositoryBase: 'https://github.com/LibreChat-AI/librechat.ai/tree/main',
footer: {
content: <FooterMenu />,
},
head: () => {
const { asPath, defaultLocale, locale } = useRouter()
const { frontMatter, title: pageTitle } = useConfig()
const url = 'https://librechat.ai' + (defaultLocale === locale ? asPath : `/${locale}${asPath}`)
const description = frontMatter.description ?? ''
const title = frontMatter.title ?? pageTitle
// Default frontmatter image based on path
const defaultImage = asPath.startsWith('/docs')
? '/images/socialcards/default-docs-image.png'
: asPath.startsWith('/blog')
? '/images/socialcards/default-blog-image.png'
: asPath.startsWith('/changelog')
? '/images/socialcards/default-changelog-image.png'
: '/images/socialcards/default-image.png'
const image = frontMatter.ogImage
? 'https://www.librechat.ai' + frontMatter.ogImage // Use frontmatter image if available
: defaultImage // Use default image based on path if frontmatter image is not available
const video = frontMatter.ogVideo ? 'https://www.librechat.ai' + frontMatter.ogVideo : null
return (
<>
<meta name="theme-color" content="#000" />
<meta property="og:url" content={url} />
<meta httpEquiv="Content-Language" content="en" />
<meta name="title" content={title} />
<meta property="og:title" content={title} />
<meta name="description" content={description} />
<meta property="og:description" content={description} />
{video && <meta property="og:video" content={video} />}
<meta property="og:image" content={image} />
<meta property="twitter:image" content={image} />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site:domain" content="librechat.ai" />
<meta name="twitter:url" content="https://librechat.ai" />
<style
dangerouslySetInnerHTML={{
__html: `html { --font-geist-sans: ${GeistSans.style.fontFamily}; }`,
}}
/>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<link rel="manifest" href="/site.webmanifest" />
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />
<meta name="msapplication-TileColor" content="#da532c" />
<meta name="theme-color" content="#111111" />
</>
)
},
components: {
Frame,
Tabs,
Steps,
Cards,
FileTree,
Callout,
Button,
Carousel,
OptionTable,
},
banner: {
key: 'new-docs',
dismissible: true,
content: (
<Link href="#">
{/* mobile */}
<span className="sm:hidden">Meet the New LibreChat Resources Hub! 🚀</span>
{/* desktop */}
<span className="hidden sm:inline">Meet the New LibreChat Resources Hub! 🚀</span>
</Link>
),
},
}
export default config