Merge branch '0.9'
Conflicts: package.json
This commit is contained in:
commit
b6c68bf288
9 changed files with 53 additions and 58 deletions
4
.babelrc
Normal file
4
.babelrc
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"presets": ['react', 'es2015', 'stage-0'],
|
||||||
|
"plugins": ['add-module-exports']
|
||||||
|
}
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,2 +1,3 @@
|
||||||
node_modules/
|
node_modules/
|
||||||
public
|
public
|
||||||
|
.gatsby-context.js
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { config } from 'config'
|
import { config } from 'config'
|
||||||
import { rhythm } from 'utils/typography'
|
import { rhythm } from 'utils/typography'
|
||||||
import { link } from 'gatsby-helpers'
|
import { prefixLink } from 'gatsby-helpers'
|
||||||
|
|
||||||
class Bio extends React.Component {
|
class Bio extends React.Component {
|
||||||
render () {
|
render () {
|
||||||
|
|
@ -12,7 +12,7 @@ class Bio extends React.Component {
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
src={link('/kyle-round-small-pantheon.jpg')}
|
src={prefixLink('/kyle-round-small-pantheon.jpg')}
|
||||||
style={{
|
style={{
|
||||||
float: 'left',
|
float: 'left',
|
||||||
marginRight: rhythm(1/4),
|
marginRight: rhythm(1/4),
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Link } from 'react-router'
|
import { Link } from 'react-router'
|
||||||
import { link } from 'gatsby-helpers'
|
import { prefixLink } from 'gatsby-helpers'
|
||||||
import { prune, include as includes } from 'underscore.string'
|
import { prune, include as includes } from 'underscore.string'
|
||||||
import find from 'lodash/find'
|
import find from 'lodash/find'
|
||||||
import { rhythm, fontSizeToMS } from 'utils/typography'
|
import { rhythm, fontSizeToMS } from 'utils/typography'
|
||||||
|
|
@ -44,7 +44,7 @@ class ReadNext extends React.Component {
|
||||||
>
|
>
|
||||||
<Link
|
<Link
|
||||||
to={{
|
to={{
|
||||||
pathname: link(nextPost.path),
|
pathname: prefixLink(nextPost.path),
|
||||||
query: {
|
query: {
|
||||||
readNext: true,
|
readNext: true,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
36
html.js
36
html.js
|
|
@ -1,19 +1,20 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import DocumentTitle from 'react-document-title'
|
import DocumentTitle from 'react-document-title'
|
||||||
import { link } from 'gatsby-helpers'
|
import { prefixLink } from 'gatsby-helpers'
|
||||||
import { TypographyStyle } from 'utils/typography'
|
const TypographyStyle = require('utils/typography').TypographyStyle
|
||||||
|
|
||||||
export default class Html extends React.Component {
|
module.exports = React.createClass({
|
||||||
|
displayName: 'HTML',
|
||||||
|
propTypes: {
|
||||||
|
body: React.PropTypes.string,
|
||||||
|
},
|
||||||
render () {
|
render () {
|
||||||
const { favicon, body } = this.props
|
const { body } = this.props
|
||||||
let title = DocumentTitle.rewind()
|
const title = DocumentTitle.rewind()
|
||||||
if (this.props.title) {
|
|
||||||
title = this.props.title
|
|
||||||
}
|
|
||||||
|
|
||||||
let cssLink
|
let cssLink
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
cssLink = <link rel="stylesheet" href={link('/styles.css')} />
|
cssLink = <link rel="stylesheet" href={prefixLink('/styles.css')} />
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -25,24 +26,15 @@ export default class Html extends React.Component {
|
||||||
name="viewport"
|
name="viewport"
|
||||||
content="width=device-width, initial-scale=1.0 maximum-scale=5.0"
|
content="width=device-width, initial-scale=1.0 maximum-scale=5.0"
|
||||||
/>
|
/>
|
||||||
<title>{this.props.title}</title>
|
<title>{title}</title>
|
||||||
<link rel="shortcut icon" href={favicon} />
|
|
||||||
<TypographyStyle />
|
<TypographyStyle />
|
||||||
{cssLink}
|
{cssLink}
|
||||||
</head>
|
</head>
|
||||||
<body className="landing-page">
|
<body className="landing-page">
|
||||||
<div id="react-mount" dangerouslySetInnerHTML={{ __html: body }} />
|
<div id="react-mount" dangerouslySetInnerHTML={{ __html: body }} />
|
||||||
<script src={link('/bundle.js')} />
|
<script src={prefixLink('/bundle.js')} />
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
)
|
)
|
||||||
}
|
},
|
||||||
}
|
})
|
||||||
|
|
||||||
Html.propTypes = {
|
|
||||||
body: React.PropTypes.string,
|
|
||||||
favicon: React.PropTypes.string,
|
|
||||||
title: React.PropTypes.string,
|
|
||||||
}
|
|
||||||
|
|
||||||
Html.defaultProps = { body: '' }
|
|
||||||
|
|
|
||||||
47
package.json
47
package.json
|
|
@ -1,47 +1,46 @@
|
||||||
{
|
{
|
||||||
"name": "gatsby-starter-blog",
|
"name": "gatsby-starter-blog",
|
||||||
"version": "1.0.0",
|
|
||||||
"description": "Starter Gatsby Blog",
|
"description": "Starter Gatsby Blog",
|
||||||
"main": "n/a",
|
"version": "1.0.0",
|
||||||
"scripts": {
|
|
||||||
"lint": "./node_modules/.bin/eslint --ext .js,.jsx --ignore-pattern public .",
|
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
|
||||||
"dev": "gatsby develop"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/gatsbyjs/gatsby-starter-blog.git"
|
|
||||||
},
|
|
||||||
"keywords": [
|
|
||||||
"gatsby"
|
|
||||||
],
|
|
||||||
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
|
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
|
||||||
"license": "MIT",
|
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/gatsbyjs/gatsby-starter-blog/issues"
|
"url": "https://github.com/gatsbyjs/gatsby-starter-blog/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/gatsbyjs/gatsby-starter-blog#readme",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"babel-plugin-add-module-exports": "^0.1.2",
|
||||||
|
"babel-preset-es2015": "^6.6.0",
|
||||||
|
"babel-preset-react": "^6.5.0",
|
||||||
|
"babel-preset-stage-1": "^6.5.0",
|
||||||
|
"gatsby": "^0.9.0",
|
||||||
"history": "^2.0.0",
|
"history": "^2.0.0",
|
||||||
"lodash": "^4.5.0",
|
"lodash": "^4.5.0",
|
||||||
"moment": "^2.11.2",
|
"moment": "^2.11.2",
|
||||||
"react": "^0.14.7",
|
|
||||||
"react-document-title": "^2.0.1",
|
"react-document-title": "^2.0.1",
|
||||||
"react-dom": "^0.14.7",
|
|
||||||
"react-responsive-grid": "^0.3.1",
|
"react-responsive-grid": "^0.3.1",
|
||||||
"react-router": "^2.0.0",
|
|
||||||
"safe-access": "^0.1.0",
|
"safe-access": "^0.1.0",
|
||||||
"typography": "^0.7.0",
|
"typography": "^0.7.0",
|
||||||
"underscore.string": "^3.2.3"
|
"underscore.string": "^3.2.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-plugin-react-transform": "^1.1.1",
|
"babel-preset-react-hmre": "^1.1.1",
|
||||||
"eslint": "^2.4.0",
|
"eslint": "^2.4.0",
|
||||||
"eslint-config-airbnb": "^6.1.0",
|
"eslint-config-airbnb": "^6.1.0",
|
||||||
"eslint-plugin-react": "^4.2.1",
|
"eslint-plugin-react": "^4.2.1",
|
||||||
"gh-pages": "^0.11.0",
|
"gh-pages": "^0.11.0"
|
||||||
"react-transform-catch-errors": "^1.0.0",
|
},
|
||||||
"react-transform-hmr": "^1.0.0",
|
"homepage": "https://github.com/gatsbyjs/gatsby-starter-blog#readme",
|
||||||
"redbox-react": "^1.0.1"
|
"keywords": [
|
||||||
|
"gatsby"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"main": "n/a",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/gatsbyjs/gatsby-starter-blog.git"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"dev": "gatsby develop",
|
||||||
|
"lint": "./node_modules/.bin/eslint --ext .js,.jsx --ignore-pattern public .",
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Link } from 'react-router'
|
import { Link } from 'react-router'
|
||||||
import { Container } from 'react-responsive-grid'
|
import { Container } from 'react-responsive-grid'
|
||||||
import { link } from 'gatsby-helpers'
|
import { prefixLink } from 'gatsby-helpers'
|
||||||
import { rhythm, fontSizeToMS } from 'utils/typography'
|
import { rhythm, fontSizeToMS } from 'utils/typography'
|
||||||
import { config } from 'config'
|
import { config } from 'config'
|
||||||
|
|
||||||
|
|
@ -11,7 +11,7 @@ class Template extends React.Component {
|
||||||
render () {
|
render () {
|
||||||
const { location, children } = this.props
|
const { location, children } = this.props
|
||||||
let header
|
let header
|
||||||
if (location.pathname === link('/')) {
|
if (location.pathname === prefixLink('/')) {
|
||||||
header = (
|
header = (
|
||||||
<h1
|
<h1
|
||||||
style={{
|
style={{
|
||||||
|
|
@ -25,7 +25,7 @@ class Template extends React.Component {
|
||||||
textDecoration: 'none',
|
textDecoration: 'none',
|
||||||
color: 'inherit',
|
color: 'inherit',
|
||||||
}}
|
}}
|
||||||
to={link('/')}
|
to={prefixLink('/')}
|
||||||
>
|
>
|
||||||
{config.blogTitle}
|
{config.blogTitle}
|
||||||
</Link>
|
</Link>
|
||||||
|
|
@ -39,7 +39,7 @@ class Template extends React.Component {
|
||||||
textDecoration: 'none',
|
textDecoration: 'none',
|
||||||
color: 'inherit',
|
color: 'inherit',
|
||||||
}}
|
}}
|
||||||
to={link('/')}
|
to={prefixLink('/')}
|
||||||
>
|
>
|
||||||
{config.blogTitle}
|
{config.blogTitle}
|
||||||
</Link>
|
</Link>
|
||||||
|
|
|
||||||
|
|
@ -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 DocumentTitle from 'react-document-title'
|
import DocumentTitle from 'react-document-title'
|
||||||
import { link } from 'gatsby-helpers'
|
import { prefixLink } from 'gatsby-helpers'
|
||||||
import { rhythm } from 'utils/typography'
|
import { rhythm } from 'utils/typography'
|
||||||
import access from 'safe-access'
|
import access from 'safe-access'
|
||||||
import { config } from 'config'
|
import { config } from 'config'
|
||||||
|
|
@ -26,7 +26,7 @@ class BlogIndex extends React.Component {
|
||||||
marginBottom: rhythm(1/4),
|
marginBottom: rhythm(1/4),
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Link to={link(page.path)}>{title}</Link>
|
<Link to={prefixLink(page.path)}>{title}</Link>
|
||||||
</li>
|
</li>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import DocumentTitle from 'react-document-title'
|
import DocumentTitle from 'react-document-title'
|
||||||
import { link } from 'gatsby-helpers'
|
|
||||||
import ReadNext from '../components/ReadNext'
|
import ReadNext from '../components/ReadNext'
|
||||||
import { rhythm } from 'utils/typography'
|
import { rhythm } from 'utils/typography'
|
||||||
import { config } from 'config'
|
import { config } from 'config'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue