Skip to content

Commit 6a418dd

Browse files
committed
update
1 parent ab77428 commit 6a418dd

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

src/components/Comments/index.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import {JSX} from "react";
2+
import Giscus from "@giscus/react";
3+
import {useColorMode} from "@docusaurus/theme-common";
4+
5+
export default function Comments(): JSX.Element {
6+
const {colorMode} = useColorMode();
7+
8+
return (
9+
<div>
10+
<Giscus
11+
id="comments"
12+
repo="echo-cool-coding/cool-coding"
13+
repoId="R_kgDOPlgCWQ"
14+
category="General"
15+
categoryId="DIC_kwDOPlgCWc4Cutzh"
16+
mapping="pathname"
17+
strict="0"
18+
reactionsEnabled="1"
19+
emitMetadata="0"
20+
inputPosition="top"
21+
theme={colorMode === "dark" ? "dark_tritanopia" : "light_tritanopia"}
22+
lang="zh-CN"
23+
loading="lazy"
24+
/>
25+
</div>
26+
);
27+
}

src/theme/DocItem/Footer/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from 'react';
2+
import Footer from '@theme-original/DocItem/Footer';
3+
import Comments from "../../../components/Comments";
4+
5+
export default function FooterWrapper(props) {
6+
return (
7+
<>
8+
<Footer {...props} />
9+
<br/>
10+
<hr/>
11+
12+
<Comments/>
13+
</>);
14+
}

0 commit comments

Comments
 (0)