Skip to content

Commit

Permalink
chore : updates commenting and reactions
Browse files Browse the repository at this point in the history
  • Loading branch information
MamboBryan committed Jun 2, 2023
1 parent cebc2b9 commit 170b590
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
1 change: 1 addition & 0 deletions blog/lambdas.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: Lambdas
authors: [mambo]
date: 2023-01-09T10:00
tags: [functions, lambda]
enableComments: true
---
### Overview

Expand Down
36 changes: 36 additions & 0 deletions src/theme/BlogPostItem/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import React from "react";
import { useBlogPost } from "@docusaurus/theme-common/internal";
import BlogPostItem from "@theme-original/BlogPostItem";
import Giscus from "@giscus/react";
import { useColorMode } from "@docusaurus/theme-common";

export default function BlogPostItemWrapper(props) {
const { metadata, isBlogPostPage } = useBlogPost();
const { frontMatter, title } = metadata;
const { enableComments } = frontMatter;
const { colorMode } = useColorMode();

return (
<>
<BlogPostItem {...props} />
{enableComments && isBlogPostPage && (
<Giscus
id="comments"
repo="MamboBryan/kotlinbits"
repoId="R_kgDOJE1rbQ"
category="Bits"
categoryId="DIC_kwDOJE1rbc4CW6Mz"
mapping="title"
strict="0"
reactionsEnabled="1"
emitMetadata="0"
inputPosition="top"
theme={colorMode}
lang="en"
loading="lazy"
crossorigin="anonymous"
/>
)}
</>
);
}
4 changes: 2 additions & 2 deletions src/theme/DocItem/Layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ export default function DocItemLayout({ children }) {
id="comments"
repo="MamboBryan/kotlinbits"
repoId="R_kgDOJE1rbQ"
category="Announcements"
categoryId="DIC_kwDOJE1rbc4CVH_Z"
category="Articles"
categoryId="DIC_kwDOJE1rbc4CW6MA"
mapping="title"
strict="0"
reactionsEnabled="1"
Expand Down

0 comments on commit 170b590

Please sign in to comment.