Skip to content

Commit 2f9465f

Browse files
committed
Use CSS for margin
1 parent 2f490a7 commit 2f9465f

File tree

3 files changed

+23
-18
lines changed

3 files changed

+23
-18
lines changed

src/components/Giscus.js renamed to src/components/Giscus/Giscus.js

+19-16
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
55
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
66
import Giscus from "@giscus/react";
77
import React from 'react';
8+
import styles from './styles.module.css';
89

910
/**
1011
* Adds a meta-tag to ensure new dicussion always add the canonical link in the initial post.
@@ -30,21 +31,23 @@ export function GiscusComponent() {
3031
const { colorMode } = useColorMode();
3132

3233
return (
33-
<Giscus
34-
repo="fflaten/docs"
35-
repoId="MDEwOlJlcG9zaXRvcnkzMDY2ODYxNTc"
36-
category="Comments"
37-
categoryId="DIC_kwDOEkeozc4CWO6M"
38-
mapping="pathname"
39-
strict="1"
40-
reactionsEnabled="1"
41-
emitMetadata="0"
42-
inputPosition="top"
43-
theme={colorMode}
44-
lang="en"
45-
loading="lazy"
46-
crossorigin="anonymous"
47-
async
48-
/>
34+
<section className={styles.commentsSection}>
35+
<Giscus
36+
repo="fflaten/docs"
37+
repoId="MDEwOlJlcG9zaXRvcnkzMDY2ODYxNTc"
38+
category="Comments"
39+
categoryId="DIC_kwDOEkeozc4CWO6M"
40+
mapping="pathname"
41+
strict="1"
42+
reactionsEnabled="1"
43+
emitMetadata="0"
44+
inputPosition="top"
45+
theme={colorMode}
46+
lang="en"
47+
loading="lazy"
48+
crossorigin="anonymous"
49+
async
50+
/>
51+
</section>
4952
);
5053
}
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.commentsSection {
2+
margin-top: 2rem;
3+
}

src/theme/DocItem/Layout/index.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import DocBreadcrumbs from '@theme/DocBreadcrumbs';
2020
import Unlisted from '@theme/Unlisted';
2121
import styles from './styles.module.css';
2222
/* Customization start */
23-
import { GiscusHead, GiscusComponent } from '../../../components/Giscus';
23+
import { GiscusHead, GiscusComponent } from '../../../components/Giscus/Giscus';
2424
/* Customization end */
2525

2626
/**
@@ -63,7 +63,6 @@ export default function DocItemLayout({ children }) {
6363
<DocItemPaginator />
6464
</div>
6565
{/* Customization start */}
66-
<br />
6766
<GiscusHead />
6867
<GiscusComponent />
6968
{/* Customization end */}

0 commit comments

Comments
 (0)