forked from graphql/graphql.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththeme.config.tsx
More file actions
95 lines (91 loc) · 2.62 KB
/
theme.config.tsx
File metadata and controls
95 lines (91 loc) · 2.62 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
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
import { DocsThemeConfig, ThemeSwitch, useConfig } from "nextra-theme-docs"
import { useRouter } from "next/router"
import { Navbar } from "@/components/navbar/navbar"
import { mdxComponents } from "@/_design-system/mdx-components"
import { GraphQLWordmarkLogo } from "@/icons"
import { Footer } from "@/components/footer"
import { NextraMdxWrapper } from "@/components/nextra-mdx-wrapper"
const graphQLLogo = (
<GraphQLWordmarkLogo className="nextra-logo h-6" title="GraphQL" />
)
export default {
backgroundColor: {
light: "251,251,249",
dark: "15,15,12",
},
head: function useHead() {
const { frontMatter, title: pageTitle } = useConfig()
const { asPath } = useRouter()
const title = `${pageTitle}${asPath === "/" ? "" : " | GraphQL"}`
const { description, canonical, image } = frontMatter
return (
<>
<title>{title}</title>
<meta property="og:title" content={title} key="meta-og-title" />
{description && (
<>
<meta
name="description"
content={description}
key="meta-description"
/>
<meta
property="og:description"
content={description}
key="meta-og-description"
/>
</>
)}
{canonical && <link rel="canonical" href={canonical} />}
{image && <meta name="og:image" content={image} />}
<meta property="og:image" content="/img/og-image.png" />
<meta property="twitter:site" content="@graphql" />
</>
)
},
// Hidden for now, new design is done, but not implemented yet.
// banner: {
// content: (
// <>
// 📣 GraphQLConf 2025 • Sept 08-10 • Amsterdam •{" "}
// <NextLink
// href="/conf/2025"
// className="underline after:font-sans after:content-['_→']"
// >
// Register Today!
// </NextLink>
// </>
// )
// key: "graphqlconf-2024",
// },
logo: graphQLLogo,
docsRepositoryBase:
"https://github.com/graphql/graphql.github.io/tree/source",
color: {
hue: 319,
lightness: {
light: 44.1,
dark: 90,
},
},
sidebar: {
defaultMenuCollapseLevel: 1,
},
footer: {
component: () => <Footer />,
content: "Copyright © 2025 The GraphQL Foundation. All rights reserved.",
},
navbar: {
component: Navbar,
extraContent: (
<ThemeSwitch lite className="max-lg:hidden [&_span]:hidden" />
),
},
toc: {
backToTop: true,
},
search: {
placeholder: "Search…",
},
components: { ...mdxComponents, wrapper: NextraMdxWrapper },
} satisfies DocsThemeConfig