-
Notifications
You must be signed in to change notification settings - Fork 4
/
theme.config.tsx
150 lines (144 loc) · 4.76 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
import type { DocsThemeConfig } from "nextra-theme-docs";
import { useConfig } from "nextra-theme-docs";
import { useRouter } from "next/router";
import { Footer } from "./components/Footer";
const logo = (
<span>
<img
src="/images/mercury-black-logo.svg"
style={{ height: "33px" }}
className="dark:hidden"
alt="Mercury Dark Logo"
></img>
<img
src="/images/mercury-white-logo.svg"
style={{ height: "33px" }}
className="hidden dark:block"
alt="Mercury Logo"
></img>
<style jsx>{`
span {
padding: 0.5rem 0.5rem 0.5rem 0;
mask-image: linear-gradient(
60deg,
black 25%,
rgba(0, 0, 0, 0.2) 50%,
black 75%
);
mask-size: 400%;
mask-position: 0%;
}
span:hover {
mask-position: 100%;
transition: mask-position 1s ease, -webkit-mask-position 1s ease;
}
`}</style>
</span>
);
const config: DocsThemeConfig = {
project: {
link: "https://github.com/mljar/mercury",
},
docsRepositoryBase: "https://github.com/mljar/runmercury-website/tree/main",
useNextSeoProps() {
const { frontMatter } = useConfig();
if (frontMatter?.ogTitle) {
return {
titleTemplate: frontMatter?.ogTitle,
};
}
const { asPath } = useRouter();
if (asPath !== "/") {
return {
titleTemplate: "%s – Mercury",
};
}
},
logo,
head: function useHead() {
const { frontMatter } = useConfig();
const { title } = useConfig();
const { route } = useRouter();
//console.log(route);
// here :)
let socialCard;
if (frontMatter?.ogImage === "widgets") {
socialCard = "https://runmercury.com/images/og-images/mercury-og-widgets.png";
} else if (frontMatter?.ogImage === "features") {
socialCard = "https://runmercury.com/images/og-images/mercury-og-features.png";
} else if (frontMatter?.ogImage === "cloud") {
socialCard = "https://runmercury.com/images/og-images/mercury-og-cloud.png";
} else if (frontMatter?.ogImage === "examples") {
socialCard = "https://runmercury.com/images/og-images/mercury-og-examples.png";
} else if (frontMatter?.ogImage === "tutorials") {
socialCard = "https://runmercury.com/images/og-images/mercury-og-tutorials.png";
} else if (frontMatter?.ogImage === "integrations") {
socialCard = "https://runmercury.com/images/og-images/mercury-og-integrations.png";
}else {
socialCard = "https://runmercury.com/images/og-images/mercury-og-default.png";
}
//console.log(socialCard);
return (
<>
<meta charSet="utf-8" />
<meta name="msapplication-TileColor" content="#fff" />
<meta name="theme-color" content="#fff" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta httpEquiv="Content-Language" content="en" />
<meta
name="description"
content={
frontMatter.description
? frontMatter.description
: "You can convert Jupyter notebooks to web applications with Mercury framework. Just create Python notebook and serve it as interactive web app in Mercury. What is more, Mercury provides interactive widgets that can be used in Jupyter Notebook. Deployment of notebooks is simplified with Mercury Cloud service."
}
/>
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content={socialCard} />
<meta name="twitter:site" content="@RunMercury" />
<meta name="twitter:site:domain" content="runmercury.com" />
<meta name="twitter:url" content="https://runmercury.com" />
<meta
name="og:title"
content={
title ? title : "Build web applications in Jupyter Notebook and Mercury"
}
/>
<meta name="og:image" content={socialCard} />
<meta name="apple-mobile-web-app-title" content="Mercury" />
<link rel="icon" href="/favicon/favicon.ico" />
<link rel="manifest" href="/manifest.json" />
</>
);
},
// banner: {
// key: '2.0-release',
// text: (
// <a href="https://nextra.site" target="_blank" rel="noreferrer">
// 🎉 Nextra 2.0 is released. Read more →
// </a>
// )
// },
editLink: {
text: "Edit this page on GitHub →",
},
feedback: {
content: "Question? Give us feedback →",
labels: "feedback",
},
sidebar: {
titleComponent({ title, type }) {
if (type === "separator") {
return <span className="cursor-default">{title}</span>;
}
return <>{title}</>;
},
defaultMenuCollapseLevel: 1,
toggleButton: true,
},
footer: {
text: <Footer />,
},
//darkMode: false
};
export default config;