diff --git a/package.json b/package.json index 960bbab..8bdcf5d 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,6 @@ "author": "Bang Yongbae ", "license": "MIT", "dependencies": { - "dotenv": "4.0.0", "gatsby": "^1.9.82", "gatsby-link": "^1.6.22", "gatsby-plugin-catch-links": "^1.0.5", @@ -52,6 +51,7 @@ }, "devDependencies": { "babel-eslint": "^7.2.3", + "dotenv": "4.0.0", "eslint": "^3.x", "eslint-config-airbnb": "^13.0.0", "eslint-plugin-import": "^2.2.x", diff --git a/src/components/Disqus/Disqus.jsx b/src/components/Disqus/Disqus.jsx index bb892ac..c33a53e 100644 --- a/src/components/Disqus/Disqus.jsx +++ b/src/components/Disqus/Disqus.jsx @@ -1,7 +1,6 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import ReactDisqusComments from 'react-disqus-comments'; -import config from '../../../gatsby-config'; import { getPath } from '../../utils'; import Post from '../../models/post'; @@ -25,14 +24,14 @@ class Disqus extends Component { this.setState({ toasts }); } render() { - const { post } = this.props; - if (!config.siteMetadata.disqusShortname) { + const { post, siteMetadata } = this.props; + if (!siteMetadata.disqusShortname) { return null; } - const url = config.siteMetadata.url + encodeURI(getPath(Post, post.slug)); + const url = siteMetadata.url + encodeURI(getPath(Post, post.slug)); return ( - + ); diff --git a/src/templates/post-template.jsx b/src/templates/post-template.jsx index eba962d..a72a327 100644 --- a/src/templates/post-template.jsx +++ b/src/templates/post-template.jsx @@ -47,6 +47,8 @@ export const pageQuery = graphql` name about } + disqusShortname + url } } contentfulPost (id: { eq: $id }) {