gatsby-starter-personal-blog
gatsby-starter-personal-blog copied to clipboard
Add support for DISQUS comments
having an option to build with DISQUS as comments plugin would be nice!
@hendra-go is using this in his branch already, ultimately we are all waiting for @greglobinski regarding issue https://github.com/greglobinski/gatsby-starter-personal-blog/issues/64
Well, i actually removed disqus and try to implement my own custom commenting system using gatsby + firebase realtime database.
But if you still want to use disqus, it is not that complicated i guess.
first: You need to install react-disqus-comments. yarn add react-disqus-comments
or npm install react-disqus-comments
second: In src/components/Post/PostFooter.js
remove facebook props from PostComments
<PostComments post={post} slug={slug} facebook={facebook} />
becomes <PostComments post={post} slug={slug} />
third: In src/components/Post/PostComments.js
replace react-facebook with react-disqus-comments`
like this:
import ReactDisqusComments from "react-disqus-comments";
.
.
.
const PostComments = props => {
const { classes, slug, post} = props;
return (
<div id="post-comments" className={classes.postComments}>
<ReactDisqusComments
shortname="YOUR_DISQUS_SHORTNAME"
identifier={post.title}
title={post.title}
url={`${config.siteUrl}${slug}`}
category_id={post.category_id}
/>
</div>
);
};