<commit_before>import React from 'react';
import moment from 'moment';
import { Link } from 'react-router';
import { prefixLink } from 'gatsby-helpers';
import { config } from 'config';
import ReadNext from '../ReadNext';
import './style.css';
import '../../static/css/highlight.css';
import Header from '../Header';
import Comments from 'react-disqus-thread';

class SitePost extends React.Component {
  render() {
    const { route } = this.props;
    const post = route.page.data.publish === true ? route.page.data : {
      date: moment().format('D MMM YYYY'),
      title: 'Invalid Article',
      body: '<p>This article is not ready for prime-time yet.  Please check back later.</p>',
      author: 'Unknown',
      authorTwitterUrl: 'None',
    };

    return (
      <div>
        <Header />
        <div className="blog-single">
          <div className="text">
            <h1>{post.title}</h1>
            <div dangerouslySetInnerHTML={{ __html: post.body }} />
            <div className="date-published">
              <em>Published {moment(post.date).format('D MMM YYYY')}</em>
            </div>
          </div>
          <div className="footer">
            <ReadNext post={post} {...this.props} />
            <hr />
            <p>
              {config.siteDescr}
              <a href={post.authorTwitterUrl ? post.authorTwitterUrl : config.siteTwitterUrl}>
                <br /> <strong>{post.author ? post.author : config.siteAuthor}</strong> on Twitter
              </a>
            </p>
          </div>
          <Comments
            shortname={config.disqusShortname}
            identifier={post.path}
            title={post.title}
            url={window.location.href}
            onNewComment={this.handleNewComment}
          />
        </div>
      </div>
    );
  }
}

SitePost.propTypes = {
  route: React.PropTypes.object.isRequired,
};

export default SitePost;<commit_msg><ST>Hack of pulling url for disqus from config instead of window since  react-disqus-thread throws errors during server side rendering due to window not existing<commit_after>import React from 'react';
import moment from 'moment';
import { Link } from 'react-router';
import { prefixLink } from 'gatsby-helpers';
import { config } from 'config';
import ReadNext from '../ReadNext';
import './style.css';
import '../../static/css/highlight.css';
import Header from '../Header';
import Comments from 'react-disqus-thread';

class SitePost extends React.Component {
  render() {
    const { route } = this.props;
    const post = route.page.data.publish === true ? route.page.data : {
      date: moment().format('D MMM YYYY'),
      title: 'Invalid Article',
      body: '<p>This article is not ready for prime-time yet.  Please check back later.</p>',
      author: 'Unknown',
      authorTwitterUrl: 'None',
    };

    return (
      <div>
        <Header />
        <div className="blog-single">
          <div className="text">
            <h1>{post.title}</h1>
            <div dangerouslySetInnerHTML={{ __html: post.body }} />
            <div className="date-published">
              <em>Published {moment(post.date).format('D MMM YYYY')}</em>
            </div>
          </div>
          <div className="footer">
            <ReadNext post={post} {...this.props} />
            <hr />
            <p>
              {config.siteDescr}
              <a href={post.authorTwitterUrl ? post.authorTwitterUrl : config.siteTwitterUrl}>
                <br /> <strong>{post.author ? post.author : config.siteAuthor}</strong> on Twitter
              </a>
            </p>
          </div>
          <Comments
            shortname={config.disqusShortname}
            identifier={post.path}
            title={post.title}
            url={`${config.productionHostname}${post.path}`}
            onNewComment={this.handleNewComment}
          />
        </div>
      </div>
    );
  }
}

SitePost.propTypes = {
  route: React.PropTypes.object.isRequired,
};

export default SitePost;
{'fraction_non_alphanumeric': 0.14507253626813407, 'fraction_numerical': 0.0010005002501250625, 'mean_word_length': 2.136470588235294, 'pattern_counts': {'":': 0, '<': 60, '<?xml version=': 0, '>': 60, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4013244', 'n_tokens_mistral': 1144, 'n_tokens_neox': 1135, 'n_words': 278}