Merge remote-tracking branch 'wpioneer/master'

This commit is contained in:
Ihor Orlovskyi 2016-12-09 22:42:26 +02:00
commit 7ade116485
9 changed files with 42 additions and 49 deletions

View File

@ -1,6 +1,6 @@
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2015 gatsbyjs Copyright (c) 2016
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -18,5 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.

View File

@ -23,16 +23,16 @@ Install this starter (assuming Gatsby is installed) by running from your CLI:
[Statinamic port](https://github.com/thangngoc89/statinamic-theme-lumen) by [Khoa Nguyen](https://github.com/thangngoc89) [Statinamic port](https://github.com/thangngoc89/statinamic-theme-lumen) by [Khoa Nguyen](https://github.com/thangngoc89)
## License ## License
The MIT license. The MIT License (MIT)
Copyright (c) 2016 Alexandr Shelepenok [ashk.io](http://ashk.io) Copyright (c) 2016
Permission is hereby granted, free of charge, to any person obtaining a copy of Permission is hereby granted, free of charge, to any person obtaining a copy
this software and associated documentation files (the "Software"), to deal in of this software and associated documentation files (the "Software"), to deal
the Software without restriction, including without limitation the rights to in the Software without restriction, including without limitation the rights
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
of the Software, and to permit persons to whom the Software is furnished to do copies of the Software, and to permit persons to whom the Software is
so, subject to the following conditions: furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. copies or substantial portions of the Software.

View File

@ -10,15 +10,15 @@ class SiteNav extends React.Component {
<nav className='blog-nav'> <nav className='blog-nav'>
<ul> <ul>
<li> <li>
<Link to="/" className={ location.pathname === prefixLink('/') ? "current" : null }> Articles <Link to="/" activeClassName="current" onlyActiveOnIndex> Articles
</Link> </Link>
</li> </li>
<li> <li>
<Link to="/about/" className={ location.pathname === prefixLink('/about/') ? "current" : null }> About me <Link to="/about/" activeClassName="current"> About me
</Link> </Link>
</li> </li>
<li> <li>
<Link to="/contact/" className={ location.pathname === prefixLink('/contact/') ? "current" : null }> Contact me <Link to="/contact/" activeClassName="current"> Contact me
</Link> </Link>
</li> </li>
</ul> </ul>
@ -31,4 +31,4 @@ SiteNav.propTypes = {
location: React.PropTypes.object, location: React.PropTypes.object,
} }
export default SiteNav export default SiteNav

View File

@ -2,7 +2,6 @@ import React from 'react'
import moment from 'moment' import moment from 'moment'
import { RouteHandler, Link } from 'react-router' import { RouteHandler, Link } from 'react-router'
import { prefixLink } from 'gatsby-helpers' import { prefixLink } from 'gatsby-helpers'
import DocumentTitle from 'react-document-title'
import access from 'safe-access' import access from 'safe-access'
import { config } from 'config' import { config } from 'config'
import SiteSidebar from '../SiteSidebar' import SiteSidebar from '../SiteSidebar'
@ -38,4 +37,4 @@ SitePage.propTypes = {
pages: React.PropTypes.array, pages: React.PropTypes.array,
} }
export default SitePage export default SitePage

View File

@ -1,7 +1,6 @@
import React from 'react' import React from 'react'
import moment from 'moment' import moment from 'moment'
import { RouteHandler, Link } from 'react-router' import { RouteHandler, Link } from 'react-router'
import DocumentTitle from 'react-document-title'
import { prefixLink } from 'gatsby-helpers' import { prefixLink } from 'gatsby-helpers'
import access from 'safe-access' import access from 'safe-access'
import { config } from 'config' import { config } from 'config'

10
html.js
View File

@ -1,5 +1,5 @@
import React from 'react' import React from 'react'
import DocumentTitle from 'react-document-title' import Helmet from 'react-helmet'
import { prefixLink } from 'gatsby-helpers' import { prefixLink } from 'gatsby-helpers'
const BUILD_TIME = new Date().getTime() const BUILD_TIME = new Date().getTime()
@ -11,7 +11,7 @@ module.exports = React.createClass({
}, },
render() { render() {
const {body, route} = this.props const {body, route} = this.props
const title = DocumentTitle.rewind() const {title} = Helmet.rewind()
const font = <link href='https://fonts.googleapis.com/css?family=Roboto:400,400italic,500,700&subset=latin,cyrillic' rel='stylesheet' type='text/css' /> const font = <link href='https://fonts.googleapis.com/css?family=Roboto:400,400italic,500,700&subset=latin,cyrillic' rel='stylesheet' type='text/css' />
let css let css
if (process.env.NODE_ENV === 'production') { if (process.env.NODE_ENV === 'production') {
@ -24,9 +24,7 @@ module.exports = React.createClass({
<meta charSet="utf-8" /> <meta charSet="utf-8" />
<meta httpEquiv="X-UA-Compatible" content="IE=edge" /> <meta httpEquiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0 maximum-scale=5.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0 maximum-scale=5.0" />
<title> { title.toComponent() }
{ title }
</title>
{ font } { font }
{ css } { css }
</head> </head>
@ -37,4 +35,4 @@ module.exports = React.createClass({
</html> </html>
) )
}, },
}) })

View File

@ -34,14 +34,15 @@
"markdown-it": "^6.0.2", "markdown-it": "^6.0.2",
"moment": "^2.14.1", "moment": "^2.14.1",
"react": "^15.3.0", "react": "^15.3.0",
"react-document-title": "^2.0.2",
"react-dom": "^15.3.0", "react-dom": "^15.3.0",
"react-ga": "^2.1.2", "react-ga": "^2.1.2",
"react-helmet": "^3.2.2",
"react-router": "^2.6.1", "react-router": "^2.6.1",
"safe-access": "^0.1.0", "safe-access": "^0.1.0",
"underscore.string": "^3.2.3" "underscore.string": "^3.2.3"
}, },
"devDependencies": { "devDependencies": {
"autoprefixer": "^6.3.7",
"babel-core": "^6.11.4", "babel-core": "^6.11.4",
"babel-loader": "^6.2.4", "babel-loader": "^6.2.4",
"babel-preset-react-hmre": "^1.1.1", "babel-preset-react-hmre": "^1.1.1",
@ -51,18 +52,17 @@
"eslint-plugin-import": "^1.12.0", "eslint-plugin-import": "^1.12.0",
"eslint-plugin-jsx-a11y": "^2.0.1", "eslint-plugin-jsx-a11y": "^2.0.1",
"eslint-plugin-react": "^6.0.0", "eslint-plugin-react": "^6.0.0",
"file-loader": "^0.9.0",
"gh-pages": "^0.11.0", "gh-pages": "^0.11.0",
"image-webpack-loader": "^2.0.0", "image-webpack-loader": "^2.0.0",
"lost": "^7.0.3",
"null-loader": "^0.1.1", "null-loader": "^0.1.1",
"postcss-loader": "^0.9.1", "postcss-loader": "^0.9.1",
"react-transform-catch-errors": "^1.0.2", "react-transform-catch-errors": "^1.0.2",
"react-transform-hmr": "^1.0.4", "react-transform-hmr": "^1.0.4",
"redbox-react": "^1.2.10", "redbox-react": "^1.2.10",
"style-loader": "^0.13.1",
"webpack": "^1.13.1",
"autoprefixer": "^6.3.7",
"file-loader": "^0.9.0",
"rucksack-css": "^0.8.5", "rucksack-css": "^0.8.5",
"lost": "^7.0.3" "style-loader": "^0.13.1",
"webpack": "^1.13.1"
} }
} }

View File

@ -2,7 +2,7 @@ import React from 'react'
import { Link } from 'react-router' import { Link } from 'react-router'
import sortBy from 'lodash/sortBy' import sortBy from 'lodash/sortBy'
import moment from 'moment' import moment from 'moment'
import DocumentTitle from 'react-document-title' import Helmet from 'react-helmet'
import { prefixLink } from 'gatsby-helpers' import { prefixLink } from 'gatsby-helpers'
import access from 'safe-access' import access from 'safe-access'
import { config } from 'config' import { config } from 'config'
@ -39,19 +39,18 @@ class SiteIndex extends React.Component {
}) })
return ( return (
<DocumentTitle title={ config.siteTitle }> <div>
<div> <Helmet title={ config.siteTitle }/>
<SiteSidebar {...this.props}/> <SiteSidebar {...this.props}/>
<div className='content'> <div className='content'>
<div className='main'> <div className='main'>
<div className='main-inner'> <div className='main-inner'>
{ pageLinks } { pageLinks }
</div>
</div> </div>
</div> </div>
</div> </div>
</DocumentTitle> </div>
) )
} }
} }
@ -59,4 +58,4 @@ SiteIndex.propTypes = {
route: React.PropTypes.object, route: React.PropTypes.object,
} }
export default SiteIndex export default SiteIndex

View File

@ -1,5 +1,5 @@
import React from 'react' import React from 'react'
import DocumentTitle from 'react-document-title' import Helmet from 'react-helmet'
import SitePost from '../components/SitePost' import SitePost from '../components/SitePost'
import SitePage from '../components/SitePage' import SitePage from '../components/SitePage'
import { config } from 'config' import { config } from 'config'
@ -19,11 +19,10 @@ class MarkdownWrapper extends React.Component {
} }
return ( return (
<DocumentTitle title={ `${post.title} - ${config.siteTitle}` }> <div>
<div> <Helmet title={ `${post.title} - ${config.siteTitle}` }/>
{ template } { template }
</div> </div>
</DocumentTitle>
); );
} }
} }
@ -32,4 +31,4 @@ MarkdownWrapper.propTypes = {
route: React.PropTypes.object, route: React.PropTypes.object,
} }
export default MarkdownWrapper export default MarkdownWrapper