Skip to content

Commit

Permalink
feat: giscus (#74)
Browse files Browse the repository at this point in the history
* chore: install @giscus/react

@giscus/react 패키지 설치.

* feat: create Giscus.jsx component

Giscus.jsx 컴포넌트 제작.

* rename: move Giscus component from main to section

Giscus 컴포넌트를 main에서 section으로 이동.

* feat: create layouts/Section.jsx component

layouts/Section.jsx 컴포넌트 제작.

* feat: create app/docs/[...categories]/layout.jsx

layout.jsx 제작.
  • Loading branch information
lumirlumir authored Sep 21, 2024
1 parent 8247f82 commit d3e17b9
Show file tree
Hide file tree
Showing 8 changed files with 126 additions and 0 deletions.
74 changes: 74 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"count-docs": "ls -R src/posts/docs | grep .md | wc -l"
},
"dependencies": {
"@giscus/react": "^3.0.0",
"@vercel/analytics": "^1.3.1",
"@vercel/speed-insights": "^1.0.12",
"github-markdown-css": "^5.6.1",
Expand Down
13 changes: 13 additions & 0 deletions src/app/docs/[...categories]/layout.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Section from '@/components/layouts/Section/Section';
import Giscus from '@/components/section/Giscus';

export default function Layout({ children }) {
return (
<>
{children}
<Section>
<Giscus />
</Section>
</>
);
}
5 changes: 5 additions & 0 deletions src/components/layouts/Section/Section.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import styles from './Section.module.scss';

export default function Section({ children }) {
return <section className={styles.section}>{children}</section>;
}
3 changes: 3 additions & 0 deletions src/components/layouts/Section/Section.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.section {
margin: 50px 0;
}
3 changes: 3 additions & 0 deletions src/components/layouts/Section/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Section from './Section';

export default Section;
24 changes: 24 additions & 0 deletions src/components/section/Giscus/Giscus.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'use client';

import GiscusOriginal from '@giscus/react';

import { REPOSITORY } from '@/constants/github';

export default function Giscus() {
return (
<GiscusOriginal
repo={REPOSITORY.fullName}
repoId="R_kgDOLa_QgA"
category="comments"
categoryId="DIC_kwDOLa_QgM4ChivI"
mapping="pathname"
strict="0"
reactionsEnabled="1"
emitMetadata="0"
inputPosition="top"
theme="preferred_color_scheme"
lang="ko"
loading="lazy"
/>
);
}
3 changes: 3 additions & 0 deletions src/components/section/Giscus/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Giscus from './Giscus';

export default Giscus;

0 comments on commit d3e17b9

Please sign in to comment.