gatsby-starter-personal-blog icon indicating copy to clipboard operation
gatsby-starter-personal-blog copied to clipboard

Add support for DISQUS comments

Open tm9k1 opened this issue 6 years ago • 2 comments

having an option to build with DISQUS as comments plugin would be nice!

tm9k1 avatar Jan 25 '19 11:01 tm9k1

@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

LeBaux avatar Jan 30 '19 07:01 LeBaux

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>
  );
};

hendra-go avatar Feb 21 '19 06:02 hendra-go