-
Notifications
You must be signed in to change notification settings - Fork 0
/
theme.config.tsx
81 lines (77 loc) · 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
import { useRouter } from "next/router"
import { DocsThemeConfig, useConfig } from "nextra-theme-docs"
import FrescoByRadish from "@/components/FrescoByRadish"
import { SEO, TWITTER_HANDLE } from "./constants/seo"
const config: DocsThemeConfig = {
useNextSeoProps,
banner: {
key: "storybook-playground",
text: (
<a href="https://fresco-storybook.vercel.app" target="_blank">
🎉 Storybook{" "}
<span className="hidden sm:inline">
playground available for alpha release
</span>
<span className="sm:hidden">live now</span>. Try out →
</a>
),
},
logo: <FrescoByRadish />,
project: {
link: "https://github.com/rabani-to/fresco",
},
chat: {
link: "https://discord.gg/KpdmyTdNX7",
},
editLink: {
text: "Edit this page on Github →",
},
docsRepositoryBase: "https://github.com/rabani-to/gofres.co/tree/master",
footer: {
text: `${new Date().getFullYear()} – Fresco, Radish.`,
},
}
function useNextSeoProps() {
const { title } = useConfig()
const { asPath } = useRouter()
return {
titleTemplate: "%s – Fresco",
title: asPath === "/" ? "Home" : title,
additionalLinkTags: [
"/favicon.png",
"/favicon.svg",
"/favicon-dark.png",
"/favicon-dark.svg",
].map((href) => {
const isSVG = href.includes("svg")
const isDark = href.includes("-dark")
return {
rel: "icon",
type: isSVG ? "image/svg+xml" : "image/png",
media: isDark ? "(prefers-color-scheme: dark)" : undefined,
href,
}
}),
twitter: {
cardType: "summary_large_image",
handle: TWITTER_HANDLE,
site: SEO.url,
},
openGraph: {
type: "website",
url: SEO.url,
title: SEO.title,
description: SEO.description,
images: [
{
url: SEO.imageURL,
alt: SEO.imageURL,
width: 800,
height: 800,
},
],
},
description: SEO.description,
}
}
export default config