Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions app/components/GiscusComments.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
'use client';
"use client";

import Giscus from '@giscus/react';
import Giscus from "@giscus/react";

interface GiscusCommentsProps {
className?: string;
docId?: string | null;
}

export function GiscusComments({ className }: GiscusCommentsProps) {
export function GiscusComments({ className, docId }: GiscusCommentsProps) {
const useDocId = typeof docId === "string" && docId.trim().length > 0;

return (
<div className={className}>
<Giscus
repo="InvolutionHell/involutionhell.github.io"
repoId="R_kgDOPuD_8A"
category="Comments"
categoryId="DIC_kwDOPuD_8M4Cvip8"
mapping="pathname"
mapping={useDocId ? "specific" : "pathname"}
term={useDocId ? docId : undefined}
strict="0"
reactionsEnabled="1"
emitMetadata="0"
Expand Down
2 changes: 1 addition & 1 deletion app/docs/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default async function DocPage({ params }: Param) {
<Mdx components={getMDXComponents()} />
<Contributors entry={contributorsEntry} />
<section className="mt-16">
<GiscusComments />
<GiscusComments docId={docIdFromPage ?? null} />
</section>
</DocsBody>
</DocsPage>
Expand Down