Skip to content

Commit

Permalink
Add comments with Giscus
Browse files Browse the repository at this point in the history
  • Loading branch information
bradystroud committed May 21, 2024
1 parent 13770fa commit 76b86f0
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 6 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"postcss-nesting": "^12.1.4"
},
"dependencies": {
"@giscus/react": "^3.0.0",
"@headlessui/react": "2.0.3",
"@tailwindcss/typography": "^0.5.13",
"next": "^14.2.3",
Expand All @@ -40,4 +41,4 @@
"resolutions": {
"final-form": "4.20.1"
}
}
}
27 changes: 22 additions & 5 deletions pages/reviews/[filename].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { TinaMarkdown } from "tinacms/dist/rich-text";
import { InferGetStaticPropsType } from "next";
import Head from "next/head";
import Image from "next/image";
import Giscus from "@giscus/react";

export default function ReviewPage(
props: InferGetStaticPropsType<typeof getStaticProps>
Expand All @@ -30,19 +31,18 @@ export default function ReviewPage(
}

if (data && data.review) {
const title = `${data.review.restaurant.name} | Parmi Picks`;

return (
<Layout data={data.global as any}>
<Head>
<title>{data.review.restaurant.name} | ParmiPicks</title>
<title>{title}</title>
<link
rel="canonical"
href={data.review.cannonicalUrl}
key="canonical"
/>
<meta
property="og:title"
content={`${data.review.restaurant.name} | Parmi Picks`}
/>
<meta property="og:title" content={title} />
<script type="application/ld+json">
{JSON.stringify({
"@context": "https://schema.org",
Expand Down Expand Up @@ -123,6 +123,23 @@ export default function ReviewPage(
<div className="prose dark:prose-dark w-full max-w-none">
<TinaMarkdown content={data.review._body} />
</div>
<br />
<Giscus
key={title}
repo="bradystroud/parmipicks"
category="Comments"
categoryId="DIC_kwDOJVwLxc4CfgKc"
repoId="R_kgDOJVwLxQ"
mapping="title"
strict="0"
reactionsEnabled="1"
emitMetadata="0"
inputPosition="top"
theme="light"
lang="en"
loading="lazy"
term="Welcome to Parmi Picks! Leave a comment or ask a question."
/>
</Container>
</Section>
</Layout>
Expand Down
56 changes: 56 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1628,6 +1628,13 @@
dependencies:
tslib "^2.4.0"

"@giscus/react@^3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@giscus/react/-/react-3.0.0.tgz#fdadce2c7e4023eb4fdbcc219cdd97f6d7aa17f0"
integrity sha512-hgCjLpg3Wgh8VbTF5p8ZLcIHI74wvDk1VIFv12+eKhenNVUDjgwNg2B1aq/3puyHOad47u/ZSyqiMtohjy/OOA==
dependencies:
giscus "^1.5.0"

"@graphiql/react@^0.18.0-alpha.1":
version "0.18.0"
resolved "https://registry.yarnpkg.com/@graphiql/react/-/react-0.18.0.tgz#7ddff7c664385c1a05f0eac1d69cd9147d38006e"
Expand Down Expand Up @@ -2178,6 +2185,18 @@
dependencies:
"@lezer/common" "^1.0.0"

"@lit-labs/ssr-dom-shim@^1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@lit-labs/ssr-dom-shim/-/ssr-dom-shim-1.2.0.tgz#353ce4a76c83fadec272ea5674ede767650762fd"
integrity sha512-yWJKmpGE6lUURKAaIltoPIE/wrbY3TEkqQt+X0m+7fQNnAv0keydnYvbiJFP1PnMhizmIWRWOG5KLhYyc/xl+g==

"@lit/reactive-element@^2.0.4":
version "2.0.4"
resolved "https://registry.yarnpkg.com/@lit/reactive-element/-/reactive-element-2.0.4.tgz#8f2ed950a848016383894a26180ff06c56ae001b"
integrity sha512-GFn91inaUa2oHLak8awSIigYz0cU0Payr1rcFsrkf5OJ5eSPxElyZfKh0f2p9FsTiZWXQdWGJeXZICEfXXYSXQ==
dependencies:
"@lit-labs/ssr-dom-shim" "^1.2.0"

"@monaco-editor/loader@^1.3.2":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@monaco-editor/loader/-/loader-1.4.0.tgz#f08227057331ec890fa1e903912a5b711a2ad558"
Expand Down Expand Up @@ -3404,6 +3423,11 @@
dependencies:
"@types/estree" "*"

"@types/trusted-types@^2.0.2":
version "2.0.7"
resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.7.tgz#baccb07a970b91707df3a3e8ba6896c57ead2d11"
integrity sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==

"@types/unist@^2", "@types/unist@^2.0.0", "@types/unist@^2.0.2":
version "2.0.10"
resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.10.tgz#04ffa7f406ab628f7f7e97ca23e290cd8ab15efc"
Expand Down Expand Up @@ -5718,6 +5742,13 @@ get-nonce@^1.0.0:
resolved "https://registry.yarnpkg.com/get-nonce/-/get-nonce-1.0.1.tgz#fdf3f0278073820d2ce9426c18f07481b1e0cdf3"
integrity sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==

giscus@^1.5.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/giscus/-/giscus-1.5.0.tgz#8299fa056b2ed31ec8b05d4645871e016982b4b2"
integrity sha512-t3LL0qbSO3JXq3uyQeKpF5CegstGfKX/0gI6eDe1cmnI7D56R7j52yLdzw4pdKrg3VnufwCgCM3FDz7G1Qr6lg==
dependencies:
lit "^3.1.2"

[email protected]:
version "0.0.0"
resolved "https://registry.yarnpkg.com/github-from-package/-/github-from-package-0.0.0.tgz#97fb5d96bfde8973313f20e8288ef9a167fa64ce"
Expand Down Expand Up @@ -6458,6 +6489,31 @@ linkify-it@^3.0.1:
dependencies:
uc.micro "^1.0.1"

lit-element@^4.0.4:
version "4.0.5"
resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-4.0.5.tgz#f20cd8a6231eaf5358f7a6877ca6ea7628fa2015"
integrity sha512-iTWskWZEtn9SyEf4aBG6rKT8GABZMrTWop1+jopsEOgEcugcXJGKuX5bEbkq9qfzY+XB4MAgCaSPwnNpdsNQ3Q==
dependencies:
"@lit-labs/ssr-dom-shim" "^1.2.0"
"@lit/reactive-element" "^2.0.4"
lit-html "^3.1.2"

lit-html@^3.1.2:
version "3.1.3"
resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-3.1.3.tgz#ae2e9fee0258d0a1b5d7b86c87da51117e4f911b"
integrity sha512-FwIbqDD8O/8lM4vUZ4KvQZjPPNx7V1VhT7vmRB8RBAO0AU6wuTVdoXiu2CivVjEGdugvcbPNBLtPE1y0ifplHA==
dependencies:
"@types/trusted-types" "^2.0.2"

lit@^3.1.2:
version "3.1.3"
resolved "https://registry.yarnpkg.com/lit/-/lit-3.1.3.tgz#809ecdaccfea47e1e3b46649fae6c6e7b9802675"
integrity sha512-l4slfspEsnCcHVRTvaP7YnkTZEZggNFywLEIhQaGhYDczG+tu/vlgm/KaWIEjIp+ZyV20r2JnZctMb8LeLCG7Q==
dependencies:
"@lit/reactive-element" "^2.0.4"
lit-element "^4.0.4"
lit-html "^3.1.2"

locate-path@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0"
Expand Down

0 comments on commit 76b86f0

Please sign in to comment.