diff --git a/src/components/Disqus/Disqus.jsx b/src/components/Disqus/Disqus.jsx index 6a8b2d7..2486c63 100644 --- a/src/components/Disqus/Disqus.jsx +++ b/src/components/Disqus/Disqus.jsx @@ -1,6 +1,5 @@ import React, { Component } from 'react'; import ReactDisqusComments from 'react-disqus-comments'; -import config from '../../../gatsby-config'; class Disqus extends Component { constructor(props) { @@ -20,15 +19,15 @@ class Disqus extends Component { this.setState({ toasts }); } render() { - const { postNode } = this.props; - if (!config.siteMetadata.disqusShortname) { + const { postNode, siteMetadata } = this.props; + if (!siteMetadata.disqusShortname) { return null; } const post = postNode.frontmatter; - const url = config.siteMetadata.url + postNode.fields.slug; + const url = siteMetadata.url + postNode.fields.slug; return ( - + ); diff --git a/src/templates/post-template.jsx b/src/templates/post-template.jsx index 386a58b..9ddfb93 100644 --- a/src/templates/post-template.jsx +++ b/src/templates/post-template.jsx @@ -34,6 +34,8 @@ export const pageQuery = graphql` name twitter } + disqusShortname + url } } markdownRemark(fields: { slug: { eq: $slug } }) {