Skip to content

Commit

Permalink
【add】comment
Browse files Browse the repository at this point in the history
  • Loading branch information
lkzwc committed Oct 7, 2023
1 parent fc3bdfd commit 7a42eac
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 12 deletions.
3 changes: 0 additions & 3 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,6 @@ const config = {
{
html: `<a href="https://docusaurus.io/zh-CN/" target="_blank" rel="noreferrer noopener"><img style="height:50px;margin-top:0.5rem" src="https://www.docusaurus.cn/img/docusaurus_keytar.png" /><a/>`,
},
{
html: `<a href="https://docusaurus.io/zh-CN/" target="_blank" rel="noreferrer noopener"><img style="height:50px;margin-top:0.5rem" src="https://waline.js.org/logo.png"/><a/>`,
},
],
},
],
Expand Down
129 changes: 129 additions & 0 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@docusaurus/core": "2.4.0",
"@docusaurus/preset-classic": "2.4.0",
"@docusaurus/theme-search-algolia": "^2.4.1",
"@giscus/react": "^2.3.0",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.1.1",
"dayjs": "^1.11.9",
Expand All @@ -40,4 +41,4 @@
"last 1 safari version"
]
}
}
}
24 changes: 24 additions & 0 deletions src/components/Comment.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from "react";
import Giscus from "@giscus/react";

export default function Comment() {
return (
<div>
<Giscus
id="comments"
repo="lkzwc/fe-ddu"
repoId="R_kgDOHUkdvQ"
category="Announcements"
categoryId="DIC_kwDOHUkdvc4CYeiv"
mapping="title"
term="Welcome to @giscus/react component!"
reactionsEnabled="1"
emitMetadata="0"
inputPosition="top"
theme="preferred_color_scheme"
lang="zh-CN"
loading="lazy"
/>
</div>
);
}
10 changes: 2 additions & 8 deletions src/theme/BlogPostItem.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
// import BlogPostItem from "@theme-original/BlogPostItem";
import React from "react";
import clsx from "clsx";
// import {useBlogPost} from '@docusaurus/theme-common/internal';
import BlogPostItemContainer from "@theme/BlogPostItem/Container";
import BlogPostItemHeader from "@theme/BlogPostItem/Header";
import BlogPostItemContent from "@theme/BlogPostItem/Content";
import BlogPostItemFooter from "@theme/BlogPostItem/Footer";
import type { Props } from "@theme/BlogPostItem";
import Comment from "../components/Comment";

export default function BlogPostItem(props): JSX.Element {
// const {
// children: {
// type: { metadata },
// },
// } = props;
// console.log("propos", props);

const { children } = props;

return (
<>
<BlogPostItemHeader />
<BlogPostItemContent>{children}</BlogPostItemContent>
<BlogPostItemFooter />
<Comment />
</>
);
}

0 comments on commit 7a42eac

Please sign in to comment.