File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 1- ' use client' ;
1+ " use client" ;
22
3- import Giscus from ' @giscus/react' ;
3+ import Giscus from " @giscus/react" ;
44
55interface GiscusCommentsProps {
66 className ?: string ;
7+ docId ?: string | null ;
78}
89
9- export function GiscusComments ( { className } : GiscusCommentsProps ) {
10+ export function GiscusComments ( { className, docId } : GiscusCommentsProps ) {
11+ const useDocId = typeof docId === "string" && docId . trim ( ) . length > 0 ;
12+
1013 return (
1114 < div className = { className } >
1215 < Giscus
1316 repo = "InvolutionHell/involutionhell.github.io"
1417 repoId = "R_kgDOPuD_8A"
1518 category = "Comments"
1619 categoryId = "DIC_kwDOPuD_8M4Cvip8"
17- mapping = "pathname"
20+ mapping = { useDocId ? "specific" : "pathname" }
21+ term = { useDocId ? docId : undefined }
1822 strict = "0"
1923 reactionsEnabled = "1"
2024 emitMetadata = "0"
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ export default async function DocPage({ params }: Param) {
8686 < Mdx components = { getMDXComponents ( ) } />
8787 < Contributors entry = { contributorsEntry } />
8888 < section className = "mt-16" >
89- < GiscusComments />
89+ < GiscusComments docId = { docIdFromPage ?? null } />
9090 </ section >
9191 </ DocsBody >
9292 </ DocsPage >
You can’t perform that action at this time.
0 commit comments