+ );
+ }
}
SitePage.propTypes = {
- route: React.PropTypes.object.isRequired,
-}
+ route: React.PropTypes.object.isRequired,
+};
-export default SitePage
+export default SitePage;
diff --git a/components/SitePost/index.jsx b/components/SitePost/index.jsx
index 01a693a..c92aec7 100644
--- a/components/SitePost/index.jsx
+++ b/components/SitePost/index.jsx
@@ -1,52 +1,51 @@
-import React from 'react'
-import moment from 'moment'
-import { RouteHandler, Link } from 'react-router'
-import { prefixLink } from 'gatsby-helpers'
-import access from 'safe-access'
-import { config } from 'config'
-import ReadNext from '../ReadNext'
-import './style.css'
-import '../../static/css/highlight.css'
+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';
class SitePost extends React.Component {
- render() {
- const {route} = this.props
- const post = route.page.data
- const home = (
-
- )
+ render() {
+ const { route } = this.props;
+ const post = route.page.data;
+ const home = (
+
- { home }
-
-
-
{ post.title }
-
-
- Published { moment(post.date).format('D MMM YYYY') }
-
-
-
-
+ return (
+
+ {home}
+
+
+
{post.title}
+
+
+ Published {moment(post.date).format('D MMM YYYY')}
- );
- }
+
+
+
+
+ );
+ }
}
SitePost.propTypes = {
- route: React.PropTypes.object.isRequired
-}
+ route: React.PropTypes.object.isRequired,
+};
-export default SitePost
+export default SitePost;
diff --git a/components/SiteSidebar/index.jsx b/components/SiteSidebar/index.jsx
index 03ed8e7..5726111 100644
--- a/components/SiteSidebar/index.jsx
+++ b/components/SiteSidebar/index.jsx
@@ -1,58 +1,64 @@
-import React from 'react'
-import { RouteHandler, Link } from 'react-router'
-import { prefixLink } from 'gatsby-helpers'
-import { config } from 'config'
-import SiteNav from '../SiteNav'
-import SiteLinks from '../SiteLinks'
-import './style.css'
-import profilePic from '../../pages/photo.jpg'
+import React from 'react';
+import { Link } from 'react-router';
+import { prefixLink } from 'gatsby-helpers';
+import { config } from 'config';
+import SiteNav from '../SiteNav';
+import SiteLinks from '../SiteLinks';
+import './style.css';
+import profilePic from '../../pages/photo.jpg';
class SiteSidebar extends React.Component {
- render() {
- const {location, children} = this.props
- const isHome = location.pathname === prefixLink('/')
+ render() {
+ const { location } = this.props;
+ const isHome = location.pathname === prefixLink('/');
- let header = (
-
-
-
-
- { isHome ? (
- { config.siteAuthor }
- ) :
- { config.siteAuthor }
}
-
- { config.siteDescr }
-
-
- )
+ /* eslint-disable jsx-a11y/img-redundant-alt*/
+ const header = (
+
+
+
+
+ { isHome ? (
+ {config.siteAuthor}
+ ) :
+ {config.siteAuthor}
}
+
+ {config.siteDescr}
+
+
+ );
+ /* eslint-enable jsx-a11y/img-redundant-alt*/
- return (
-
- );
- }
+ return (
+
+ );
+ }
}
SiteSidebar.propTypes = {
- children: React.PropTypes.any,
- location: React.PropTypes.object,
-}
+ location: React.PropTypes.object,
+};
+
+export default SiteSidebar;
-export default SiteSidebar
diff --git a/gatsby-browser.js b/gatsby-browser.js
index 8ba7f29..e5fdf07 100644
--- a/gatsby-browser.js
+++ b/gatsby-browser.js
@@ -1,8 +1,8 @@
-import ReactGA from 'react-ga'
-import {config} from 'config'
+import ReactGA from 'react-ga';
+import { config } from 'config';
ReactGA.initialize(config.googleAnalyticsId);
-exports.onRouteUpdate = (state, page, pages) => {
+exports.onRouteUpdate = (state) => {
ReactGA.pageview(state.pathname);
-};
\ No newline at end of file
+};
diff --git a/gatsby-node.js b/gatsby-node.js
index e391fe1..0e71008 100644
--- a/gatsby-node.js
+++ b/gatsby-node.js
@@ -1,22 +1,22 @@
-var rucksack = require('rucksack-css')
-var lost = require("lost")
-var cssnext = require("postcss-cssnext")
+const rucksack = require('rucksack-css');
+const lost = require('lost');
+const cssnext = require('postcss-cssnext');
-exports.modifyWebpackConfig = function(config, env) {
- config.merge({
- postcss: [
- lost(),
- rucksack(),
- cssnext({
- browsers: ['>1%', 'last 2 versions']
- })
- ]
- })
+exports.modifyWebpackConfig = function (config) {
+ config.merge({
+ postcss: [
+ lost(),
+ rucksack(),
+ cssnext({
+ browsers: ['>1%', 'last 2 versions'],
+ }),
+ ],
+ });
- config.loader('svg', {
- test: /\.(svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
- loader: 'file-loader',
- })
+ config.loader('svg', {
+ test: /\.(svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
+ loader: 'file-loader',
+ });
- return config
-};
\ No newline at end of file
+ return config;
+};
diff --git a/html.js b/html.js
index fbef134..e9bec80 100644
--- a/html.js
+++ b/html.js
@@ -1,38 +1,39 @@
-import React from 'react'
-import Helmet from 'react-helmet'
-import { prefixLink } from 'gatsby-helpers'
+import React from 'react';
+import Helmet from 'react-helmet';
+import { prefixLink } from 'gatsby-helpers';
-const BUILD_TIME = new Date().getTime()
+const BUILD_TIME = new Date().getTime();
module.exports = React.createClass({
- displayName: 'HTML',
- propTypes: {
- body: React.PropTypes.string,
- },
- render() {
- const {body, route} = this.props
- const {title} = Helmet.rewind()
- const font =
- let css
- if (process.env.NODE_ENV === 'production') {
- css =
- }
+ displayName: 'HTML',
+ propTypes: {
+ body: React.PropTypes.string,
+ },
+ render() {
+ const { body } = this.props;
+ const { title } = Helmet.rewind();
+ const font =
;
+ let css;
+ if (process.env.NODE_ENV === 'production') {
+ // eslint-disable-next-line import/no-webpack-loader-syntax
+ css = ;
+ }
- return (
-
-
-
-
-
- { title.toComponent() }
- { font }
- { css }
-
-
-
-
-
-
- )
- },
-})
+ return (
+
+
+
+
+
+ { title.toComponent() }
+ { font }
+ { css }
+
+
+
+
+
+
+ );
+ },
+});
diff --git a/package.json b/package.json
index 0f22038..638e3c4 100644
--- a/package.json
+++ b/package.json
@@ -10,7 +10,7 @@
"clean": "npm run clean:public",
"copy:files": "find ./pages -maxdepth 1 -type f -regextype posix-extended -regex '.+\\.(pdf|txt|png|jpg|jpeg|gif)$' -exec cp -v {} ./public ';'",
"copy": "npm run copy:files",
- "lint": "./node_modules/.bin/eslint --ext .js,.jsx --ignore-pattern public .",
+ "lint": "./node_modules/.bin/eslint --cache --ext .js,.jsx --ignore-pattern public .",
"test": "echo \"Error: no test specified\" && exit 1",
"deploy": "gatsby build --prefix-links && gh-pages -d public"
},
diff --git a/pages/_template.jsx b/pages/_template.jsx
index d1f7432..8f13fce 100644
--- a/pages/_template.jsx
+++ b/pages/_template.jsx
@@ -1,28 +1,23 @@
-import React from 'react'
-import { Link } from 'react-router'
-import { prefixLink } from 'gatsby-helpers'
-import { config } from 'config'
+import React from 'react';
-import '../static/css/reset.css'
-import '../static/css/typography.css'
-import '../static/css/base.css'
+import '../static/css/reset.css';
+import '../static/css/typography.css';
+import '../static/css/base.css';
class Template extends React.Component {
- render() {
- const {location, children} = this.props
+ render() {
+ const { children } = this.props;
- return (
-
- { children }
-
- );
- }
+ return (
+
+ {children}
+
+ );
+ }
}
Template.propTypes = {
- children: React.PropTypes.any,
- location: React.PropTypes.object,
- route: React.PropTypes.object,
-}
+ children: React.PropTypes.any,
+};
-export default Template
\ No newline at end of file
+export default Template;
diff --git a/pages/articles/2015-05-06-my-second-post/index.md b/pages/articles/2015-05-06-my-second-post/index.md
index 582b7f1..68d20e8 100644
--- a/pages/articles/2015-05-06-my-second-post/index.md
+++ b/pages/articles/2015-05-06-my-second-post/index.md
@@ -3,6 +3,7 @@ title: My Second Post!
date: "2015-05-06T23:46:37.121Z"
layout: post
path: "/my-second-post/"
+readNext: "/hi-folks/"
category: "FrontEnd"
description: "Civil society; save lives pathway to a better life public-private partnerships solution, tackle, protect UNHCR social movement Jane Addams sustainable campaign respond equality."
---
diff --git a/pages/index.jsx b/pages/index.jsx
index fcbeeed..c0d87b3 100644
--- a/pages/index.jsx
+++ b/pages/index.jsx
@@ -1,61 +1,58 @@
-import React from 'react'
-import { Link } from 'react-router'
-import sortBy from 'lodash/sortBy'
-import moment from 'moment'
-import Helmet from 'react-helmet'
-import { prefixLink } from 'gatsby-helpers'
-import access from 'safe-access'
-import { config } from 'config'
-import SitePost from '../components/SitePost'
-import SiteSidebar from '../components/SiteSidebar'
+import React from 'react';
+import { Link } from 'react-router';
+import sortBy from 'lodash/sortBy';
+import moment from 'moment';
+import Helmet from 'react-helmet';
+import { prefixLink } from 'gatsby-helpers';
+import access from 'safe-access';
+import { config } from 'config';
+import SiteSidebar from '../components/SiteSidebar';
class SiteIndex extends React.Component {
- render() {
- const pageLinks = []
- // Sort pages.
- const sortedPages = sortBy(this.props.route.pages, (page) => access(page, 'data.date')
- ).reverse()
- sortedPages.forEach((page) => {
- if (access(page, 'file.ext') === 'md' && access(page, 'data.layout') === 'post') {
- const title = access(page, 'data.title') || page.path
- const description = access(page, 'data.description')
- const datePublished = access(page, 'data.date')
- const category = access(page, 'data.category')
+ render() {
+ const pageLinks = [];
+ // Sort pages.
+ const sortedPages = sortBy(this.props.route.pages, page => access(page, 'data.date')).reverse();
+ sortedPages.forEach((page) => {
+ if (access(page, 'file.ext') === 'md' && access(page, 'data.layout') === 'post') {
+ const title = access(page, 'data.title') || page.path;
+ const description = access(page, 'data.description');
+ const datePublished = access(page, 'data.date');
+ const category = access(page, 'data.category');
- pageLinks.push(
-
-
-
-
{ category }
-
{ title }
-
-
Read
-
-
- )
- }
- })
+ pageLinks.push((
+
+
+
+
{category}
+
{title}
+
+
Read
+
+ ));
+ }
+ });
- return (
-
-
-
-
+ return (
+
+
+
+
+
+
+ {pageLinks}
- )
- }
+
+
+
+ );
+ }
}
SiteIndex.propTypes = {
- route: React.PropTypes.object,
-}
+ route: React.PropTypes.object,
+};
-export default SiteIndex
+export default SiteIndex;
diff --git a/wrappers/md.jsx b/wrappers/md.jsx
index 6148851..2d9e5b5 100644
--- a/wrappers/md.jsx
+++ b/wrappers/md.jsx
@@ -1,34 +1,34 @@
-import React from 'react'
-import Helmet from 'react-helmet'
-import SitePost from '../components/SitePost'
-import SitePage from '../components/SitePage'
-import { config } from 'config'
+import React from 'react';
+import Helmet from 'react-helmet';
+import { config } from 'config';
+
+import SitePost from '../components/SitePost';
+import SitePage from '../components/SitePage';
class MarkdownWrapper extends React.Component {
- render() {
- const {route} = this.props
- const post = route.page.data
- let layout, template
+ render() {
+ const { route } = this.props;
+ const post = route.page.data;
+ const layout = post.layout;
+ let template;
- layout = post.layout
-
- if (layout != 'page') {
- template =
- } else {
- template =
- }
-
- return (
-
-
- { template }
-
- );
+ if (layout !== 'page') {
+ template =
;
+ } else {
+ template =
;
}
+
+ return (
+
+
+ {template}
+
+ );
+ }
}
MarkdownWrapper.propTypes = {
- route: React.PropTypes.object,
-}
+ route: React.PropTypes.object,
+};
-export default MarkdownWrapper
+export default MarkdownWrapper;