Skip to content

Commit

Permalink
Use CSS for margin
Browse files Browse the repository at this point in the history
  • Loading branch information
fflaten committed Jan 3, 2024
1 parent 2f490a7 commit 2f9465f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
35 changes: 19 additions & 16 deletions src/components/Giscus.js → src/components/Giscus/Giscus.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import Giscus from "@giscus/react";
import React from 'react';
import styles from './styles.module.css';

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

return (
<Giscus
repo="fflaten/docs"
repoId="MDEwOlJlcG9zaXRvcnkzMDY2ODYxNTc"
category="Comments"
categoryId="DIC_kwDOEkeozc4CWO6M"
mapping="pathname"
strict="1"
reactionsEnabled="1"
emitMetadata="0"
inputPosition="top"
theme={colorMode}
lang="en"
loading="lazy"
crossorigin="anonymous"
async
/>
<section className={styles.commentsSection}>
<Giscus
repo="fflaten/docs"
repoId="MDEwOlJlcG9zaXRvcnkzMDY2ODYxNTc"
category="Comments"
categoryId="DIC_kwDOEkeozc4CWO6M"
mapping="pathname"
strict="1"
reactionsEnabled="1"
emitMetadata="0"
inputPosition="top"
theme={colorMode}
lang="en"
loading="lazy"
crossorigin="anonymous"
async
/>
</section>
);
}
3 changes: 3 additions & 0 deletions src/components/Giscus/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.commentsSection {
margin-top: 2rem;
}
3 changes: 1 addition & 2 deletions src/theme/DocItem/Layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import DocBreadcrumbs from '@theme/DocBreadcrumbs';
import Unlisted from '@theme/Unlisted';
import styles from './styles.module.css';
/* Customization start */
import { GiscusHead, GiscusComponent } from '../../../components/Giscus';
import { GiscusHead, GiscusComponent } from '../../../components/Giscus/Giscus';
/* Customization end */

/**
Expand Down Expand Up @@ -63,7 +63,6 @@ export default function DocItemLayout({ children }) {
<DocItemPaginator />
</div>
{/* Customization start */}
<br />
<GiscusHead />
<GiscusComponent />
{/* Customization end */}
Expand Down

0 comments on commit 2f9465f

Please sign in to comment.