Skip to content

Commit 0980ba9

Browse files
committed
feat: ✨ add disqus comments
1 parent 8a9e798 commit 0980ba9

File tree

4 files changed

+57
-1
lines changed

4 files changed

+57
-1
lines changed

.env.production

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
YOUTUBE_KEY=it's a secret
22
CONTENTFUL_ACCESS_TOKEN=it is also secret
33
GATSBY_CLOUD_FUNCTION_CREATE_GH_ISSUE=https://us-central1-personal-site-223608.cloudfunctions.net/create-blog-typo-issue
4+
GATSBY_DISQUS_SHORTNAME=nikita-kirsanov-blog

package-lock.json

Lines changed: 44 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"@sindresorhus/slugify": "^0.8.0",
1515
"axios": "^0.18.0",
1616
"date-fns": "^2.0.0-alpha.26",
17+
"disqus-react": "^1.0.5",
1718
"gatsby": "^2.0.73",
1819
"gatsby-image": "^2.0.25",
1920
"gatsby-plugin-feed": "^2.0.11",

src/templates/blog-post.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ import { graphql } from 'gatsby'
33
import { differenceInWeeks, format } from 'date-fns/fp'
44
import { Box } from '@rebass/grid'
55
import { Like } from 'react-facebook'
6+
import { DiscussionEmbed } from 'disqus-react'
67

7-
import { BlogTags, BlogPostContent } from '../components/blog'
8+
import { BlogPostContent, BlogTags } from '../components/blog'
89
import { SEO } from '../components'
910

1011
let formatDate = format('MMMM dd, yyyy')
@@ -57,6 +58,15 @@ let BlogPost = ({
5758
<Box mt={20}>
5859
<Like href={postUrl} colorScheme="dark" showFaces share />
5960
</Box>
61+
62+
<DiscussionEmbed
63+
shortname={process.env.GATSBY_DISQUS_SHORTNAME}
64+
config={{
65+
url: postUrl,
66+
identifier: slug,
67+
title,
68+
}}
69+
/>
6070
</>
6171
)
6272
}

0 commit comments

Comments
 (0)