Merge pull request #133 from timlrx/comments

fix: giscus settings
This commit is contained in:
Timothy 2021-07-18 17:12:15 +08:00 committed by GitHub
commit fa34500c49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View File

@ -21,6 +21,7 @@ const Giscus = ({ mapping }) => {
script.src = 'https://giscus.app/client.js'
script.setAttribute('data-repo', siteMetadata.comment.giscusConfig.repo)
script.setAttribute('data-repo-id', siteMetadata.comment.giscusConfig.repositoryId)
script.setAttribute('data-category', siteMetadata.comment.giscusConfig.category)
script.setAttribute('data-category-id', siteMetadata.comment.giscusConfig.categoryId)
script.setAttribute('data-mapping', mapping)
script.setAttribute('data-reactions-enabled', siteMetadata.comment.giscusConfig.reactions)

View File

@ -152,8 +152,10 @@ comment: {
giscusConfig: {
repo: '', // username/repoName
// Visit the link below, enter your repo in the configuration section and copy the script data parameters
// Before that you should create a new Github discussions category with the Announcements type so that new discussions can only be created by maintainers and giscus
// https://giscus.app/
repositoryId: '',
category: '',
categoryId: '',
mapping: '', // supported options: pathname, url, title
reactions: '', // Emoji reactions: 1 = enable / 0 = disable

View File

@ -21,9 +21,11 @@ const siteMetadata = {
giscusConfig: {
repo: 'timlrx/tailwind-nextjs-starter-blog', // username/repoName
// Visit the link below, enter your repo in the configuration section and copy the script data parameters
// Before that you should create a new Github discussions category with the Announcements type so that new discussions can only be created by maintainers and giscus
// https://giscus.app/
repositoryId: 'MDEwOlJlcG9zaXRvcnkzMjgxMjEyNjA=',
categoryId: 'MDE4OkRpc2N1c3Npb25DYXRlZ29yeTMzMDM4NDYw',
category: 'Blog Comments',
categoryId: 'DIC_kwDOE467rM4B-XTQ',
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