Implement Giscus (#503)

* add giscus

* fix lint

* prettify

Co-authored-by: Dimitri POSTOLOV <dmytropostolov@gmail.com>
This commit is contained in:
Gil Gardosh 2022-11-06 13:19:29 +02:00 committed by GitHub
parent 0267d942cf
commit abae247179
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,28 @@
/* eslint sort-keys: error */
import { defineConfig } from '@theguild/components';
import { defineConfig, useTheme, Giscus } from '@theguild/components';
import { useRouter } from 'next/router';
export default defineConfig({
docsRepositoryBase: 'https://github.com/kamilkisiela/graphql-hive/tree/main/packages/web/docs',
main({ children }) {
const { resolvedTheme } = useTheme();
const { route } = useRouter();
return (
<>
{children}
<Giscus
// ensure giscus is reloaded when client side route is changed
key={route}
repo="kamilkisiela/graphql-hive"
repoId="R_kgDOHWr5kA"
category="Docs Discussions"
categoryId="DIC_kwDOHWr5kM4CSDSS"
mapping="pathname"
theme={resolvedTheme}
/>
</>
);
},
siteName: 'HIVE',
});