<commit_before>var React = require('react');
var Router = require('react-router');
var Route = Router.Route;
var Link = Router.Link;
var DefaultRoute = Router.DefaultRoute;

var Page = require('./page.jsx');
var HeroUnit = require('./hero-unit.jsx');
var Homepage = require('./homepage.jsx');
var urls = [];

var Foo = React.createClass({
  statics: {
    pageClassName: 'teaching-materials'
  },
  render: function() {
    return (
      <div>
        <HeroUnit image="http://placekitten.com/g/1024/480">
          <h1>I am foo.</h1>
          <div><Link to="/" className="btn btn-awsm">Meow</Link></div>
        </HeroUnit>
        <h2>Content can go here.</h2>
      </div>
    );
  }
});

var routes = (
  <Route handler={Page}>
    <Route name="/foo/" handler={Foo}/>
    <DefaultRoute name="/" handler={Homepage}/>
  </Route>
);

React.Children.forEach(routes.props.children, function(item) {
  urls.push(item.props.name);
});

exports.URLS = urls;

exports.generateStatic = function(url, cb) {
  Router.run(routes, url, function(Handler) {
    cb(React.renderToString(<Handler/>));<commit_msg>Add comment<commit_after>var React = require('react');
var Router = require('react-router');
var Route = Router.Route;
var Link = Router.Link;
var DefaultRoute = Router.DefaultRoute;

var Page = require('./page.jsx');
var HeroUnit = require('./hero-unit.jsx');
var Homepage = require('./homepage.jsx');
var urls = [];

var Foo = React.createClass({
  statics: {
    pageClassName: 'teaching-materials'
  },
  render: function() {
    return (
      <div>
        <HeroUnit image="http://placekitten.com/g/1024/480">
          <h1>I am foo.</h1>
          <div><Link to="/" className="btn btn-awsm">Meow</Link></div>
        </HeroUnit>
        <h2>Content can go here.</h2>
      </div>
    );
  }
});

var routes = (
  <Route handler={Page}>
    <Route name="/foo/" handler={Foo}/>
    <DefaultRoute name="/" handler={Homepage}/>
  </Route>
);

// TODO: come up with a better solution for nested route if we will ever have that.
React.Children.forEach(routes.props.children, function(item) {
  urls.push(item.props.name);
});

exports.URLS = urls;

exports.generateStatic = function(url, cb) {
  Router.run(routes, url, function(Handler) {
    cb(React.renderToString(<Handler/>));
{'fraction_non_alphanumeric': 0.18229623137598597, 'fraction_numerical': 0.009640666082383873, 'mean_word_length': 3.340304182509506, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, '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': '3774463', 'n_tokens_mistral': 786, 'n_tokens_neox': 773, 'n_words': 164}