Skip to content

Commit

Permalink
Adds Giscus comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bravo-kernel committed Jan 29, 2023
1 parent 92e904a commit 540dd03
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# https://wiki.dendron.so/notes/dgxeztu4fojuo9ulcwlzocu/
NEXT_PUBLIC_GISCUS_REPO=bravo-kernel/bravo-kernel.com
NEXT_PUBLIC_GISCUS_REPOSITORY_ID=R_kgDOI2pK5g
NEXT_PUBLIC_GISCUS_CATEGORY=Comments
NEXT_PUBLIC_GISCUS_CATEGORY_ID=DIC_kwDOI2pK5s4CT3ll

25 changes: 22 additions & 3 deletions data/siteMetadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,28 @@ const siteMetadata = {
// content security policy in the `next.config.js` file.
// Select a provider and use the environment variables associated to it
// https://vercel.com/docs/environment-variables
provider: 'disqus', // supported providers: giscus, utterances, disqus
disqusConfig: {
shortname: 'bravo-kernel',
provider: 'giscus', // supported providers: giscus, utterances, disqus
giscusConfig: {
// Visit the link below, and follow the steps in the 'configuration' section
// https://giscus.app/
repo: process.env.NEXT_PUBLIC_GISCUS_REPO,
repositoryId: process.env.NEXT_PUBLIC_GISCUS_REPOSITORY_ID,
category: process.env.NEXT_PUBLIC_GISCUS_CATEGORY,
categoryId: process.env.NEXT_PUBLIC_GISCUS_CATEGORY_ID,
mapping: 'pathname', // supported options: pathname, url, title
reactions: '1', // Emoji reactions: 1 = enable / 0 = disable
// Send discussion metadata periodically to the parent window: 1 = enable / 0 = disable
metadata: '0',
// theme example: light, dark, dark_dimmed, dark_high_contrast
// transparent_dark, preferred_color_scheme, custom
theme: 'light',
// theme when dark mode
darkTheme: 'transparent_dark',
// If the theme option above is set to 'custom`
// please provide a link below to your custom theme css file.
// example: https://giscus.app/themes/custom_example.css
themeURL: '',
lang: 'en',
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion layouts/PostSimple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface LayoutProps {
}

export default function PostLayout({ content, next, prev, children }: LayoutProps) {
const [loadComments, setLoadComments] = useState(false)
const [loadComments, setLoadComments] = useState(true) // load comments by default

const { path, slug, date, title } = content

Expand Down

1 comment on commit 540dd03

@vercel
Copy link

@vercel vercel bot commented on 540dd03 Jan 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.