-
Notifications
You must be signed in to change notification settings - Fork 362
Expand file tree
/
Copy paththeme.config.tsx
More file actions
49 lines (44 loc) · 1.38 KB
/
theme.config.tsx
File metadata and controls
49 lines (44 loc) · 1.38 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
/* eslint sort-keys: error */
import { useRouter } from 'next/router';
import { defineConfig, Giscus, PRODUCTS, useConfig, useTheme } from '@theguild/components';
import { ProductUpdateBlogPostHeader } from './src/components/product-update-blog-post-header';
export default defineConfig({
description: 'GraphQL Gateway Framework and anything-to-GraphQL',
docsRepositoryBase: 'https://github.com/Urigo/graphql-mesh/tree/master/website',
logo: PRODUCTS.MESH.logo({ className: 'w-8' }),
main: function Main({ children }) {
const { resolvedTheme } = useTheme();
const { route } = useRouter();
const config = useConfig();
if (route === '/product-updates') {
return <>{children}</>;
}
if (route.startsWith('/product-updates')) {
children = (
<>
<ProductUpdateBlogPostHeader meta={config.frontMatter as any} />
{children}
</>
);
}
const comments = route !== '/' && (
<Giscus
// ensure giscus is reloaded when client side route is changed
key={route}
repo="Urigo/graphql-mesh"
repoId="MDEwOlJlcG9zaXRvcnkyMzM1OTc1MTc="
category="Docs Discussions"
categoryId="DIC_kwDODexqTc4CSDDQ"
mapping="pathname"
theme={resolvedTheme}
/>
);
return (
<>
{children}
{comments}
</>
);
},
websiteName: 'GraphQL-Mesh',
});