Skip to content

Commit

Permalink
Add giscus as comment sys
Browse files Browse the repository at this point in the history
  • Loading branch information
169 committed Nov 30, 2023
1 parent 9826292 commit c64fe6c
Show file tree
Hide file tree
Showing 3 changed files with 1,313 additions and 1,460 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"tailwindcss": "^3.3.3"
},
"dependencies": {
"@giscus/react": "^2.3.0",
"astro-boilerplate-components": "169/astro-boilerplate-components#55e09ef1a6a",
"astro-embed": "^0.6.0",
"date-fns": "^2.28.0",
Expand Down
17 changes: 17 additions & 0 deletions src/partials/BlogPost.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { IFrontmatter } from 'astro-boilerplate-components';
import { PostContent, PostHeader, Section } from 'astro-boilerplate-components';
import type { ReactNode } from 'react';
import Giscus from '@giscus/react';

import { AppConfig } from '@/utils/AppConfig';

Expand All @@ -14,6 +15,22 @@ const BlogPost = (props: IBlogPostProps) => (
<PostHeader content={props.frontmatter} author={AppConfig.author} />

<PostContent content={props.frontmatter}>{props.children}</PostContent>

<Giscus
id="comments"
repo="169/169.github.io"
repoId="R_kgDOKyYnfg"
category="General"
categoryId="DIC_kwDOKyYnfs4CbYd8"
mapping="pathname"
term="Welcome to Boblin's blog!"
reactionsEnabled="1"
emitMetadata="0"
inputPosition="top"
theme="light"
lang="en"
loading="lazy"
/>
</Section>
);

Expand Down
Loading

0 comments on commit c64fe6c

Please sign in to comment.