Skip to main content

cách setup comment

settup github

vào https://github.com/ đăng ký tài khoản

vào https://github.com/new tạo mới một repository

enter image description here vào setting enter image description here kéo xuống phần Features , chọn "Set up discussions" , sửa những thông tin ở "Start a new discussion" và nhấn "start discussion" enter image description here

enter image description here

setup Giscus

vào trang https://github.com/apps/giscus
nhấn config , ở phần Repository access thì chọn "only" repo vừa tạo
enter image description here

lấy repository API key

Đăng nhập vào GraphQL API Explorer. và dán đoạn code bên dưới , nhớ thay nameOfYourGitHubAccount , nameOfCreatedRepository tương ứng lưu lại 2 thông tin id của repository và General tương ứng

query { 
repository(owner: "nameOfYourGitHubAccount", name:"nameOfCreatedRepository"){
id
discussionCategories(first:10) {
edges {
node {
id
name
}
}
}
}
}

enter image description here

Sửa Code

mở file docusaurus.config.ts và thay thế tương ứng

comment

enter image description here enter image description here

Quản lý comment

truy cập reposive trên github , vào phần discussions sẽ thấy những comment xuất hiện ở đây enter image description here