Skip to content

Commit ba862a3

Browse files
authored
Implement giscus (#2271)
1 parent 1b75742 commit ba862a3

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

website/next.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export default withGuildDocs({
77
'/docs/di': '/docs/di/introduction',
88
'/docs/legacy/recipes/type-graphql': '/docs/get-started',
99
'/docs/introduction/getting-started': '/docs/get-started',
10+
'/docs/guides/data-sources': '/docs/get-started',
1011
'/docs/guides/development-environment': '/docs/get-started',
1112
'/docs/recipes/db-connection-pooling': '/docs/get-started',
1213
'/docs/legacy/recipes/development-environment': '/docs/get-started',

website/theme.config.tsx

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
/* eslint sort-keys: error */
2-
import { ModulesLogo, defineConfig } from '@theguild/components';
2+
import {
3+
defineConfig,
4+
Giscus,
5+
ModulesLogo,
6+
useTheme,
7+
} from '@theguild/components';
8+
import { useRouter } from 'next/router';
39

410
const SITE_NAME = 'GraphQL Modules';
511

@@ -24,5 +30,27 @@ export default defineConfig({
2430
</div>
2531
</>
2632
),
33+
main: {
34+
extraContent() {
35+
const { resolvedTheme } = useTheme();
36+
const { route } = useRouter();
37+
38+
if (route === '/') {
39+
return null;
40+
}
41+
return (
42+
<Giscus
43+
// ensure giscus is reloaded when client side route is changed
44+
key={route}
45+
repo="Urigo/graphql-modules"
46+
repoId="MDEwOlJlcG9zaXRvcnkxMzI5Mjc2NjU="
47+
category="Docs Discussions"
48+
categoryId="DIC_kwDOB-xQsc4CSDST"
49+
mapping="pathname"
50+
theme={resolvedTheme}
51+
/>
52+
);
53+
},
54+
},
2755
titleSuffix: ` – ${SITE_NAME}`,
2856
});

0 commit comments

Comments
 (0)