Skip to content

Commit

Permalink
add giscuss
Browse files Browse the repository at this point in the history
  • Loading branch information
hlog-kr committed Sep 28, 2023
1 parent 5a2549c commit b745be1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions components/comments/Giscus.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ const Giscus = () => {
script.setAttribute('data-lang', lang)
script.setAttribute('data-theme', commentsTheme)
script.setAttribute('crossorigin', 'anonymous')
// 엄격한 제목 일치 사용
script.setAttribute('data-strict', '1')
script.async = true

const comments = document.getElementById(COMMENTS_ID)
Expand Down
14 changes: 7 additions & 7 deletions data/siteMetadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ 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: '', // supported providers: giscus, utterances, disqus
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,
repo: 'your_repo', //process.env.NEXT_PUBLIC_GISCUS_REPO,
repositoryId: 'your_repositoryId', //process.env.NEXT_PUBLIC_GISCUS_REPOSITORY_ID,
category: 'General', //process.env.NEXT_PUBLIC_GISCUS_CATEGORY,
categoryId: 'your_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
Expand All @@ -53,11 +53,11 @@ const siteMetadata = {
// transparent_dark, preferred_color_scheme, custom
theme: 'light',
// Place the comment box above the comments. options: bottom, top
inputPosition: 'bottom',
inputPosition: 'top', //'bottom',
// Choose the language giscus will be displayed in. options: en, es, zh-CN, zh-TW, ko, ja etc
lang: 'en',
// theme when dark mode
darkTheme: 'transparent_dark',
darkTheme: 'dark', //'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
Expand Down
2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({
const ContentSecurityPolicy = `
default-src 'self';
script-src 'self' 'unsafe-eval' 'unsafe-inline' giscus.app *.googletagmanager.com;
style-src 'self' 'unsafe-inline';
style-src 'self' 'unsafe-inline' giscus.app;
img-src * blob: data:;
media-src 'none';
connect-src *;
Expand Down

0 comments on commit b745be1

Please sign in to comment.