Skip to content

Commit

Permalink
Merge pull request gatsbyjs#4 from gesposito/master
Browse files Browse the repository at this point in the history
Update dependencies, use .js file extensions
  • Loading branch information
KyleAMathews committed Feb 21, 2016
2 parents 4d3c5ca + 65431b4 commit d70ecc1
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 21 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ Gatsby starter for creating a blog

Install this starter (assuming Gatsby is installed) by running from your CLI:
`gatsby new gatsby-blog https://github.com/gatsbyjs/gatsby-starter-blog`

## Running in development
`gatsby develop`
7 changes: 4 additions & 3 deletions components/ReadNext.jsx → components/ReadNext.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ import { rhythm, fontSizeToMS } from 'utils/typography'

class ReadNext extends React.Component {
render () {
const readNext = this.props.post.readNext
const { pages, post } = this.props
const { readNext } = post
let nextPost
if (readNext) {
nextPost = find(this.props.pages, (page) =>
nextPost = find(pages, (page) =>
includes(page.path, readNext)
)
}
if (!nextPost) {
return React.createElement('noscript', null)
} else {
nextPost = find(this.props.pages, (page) =>
nextPost = find(pages, (page) =>
includes(page.path, readNext.slice(1, -1))
)
// Create pruned version of the body.
Expand Down
18 changes: 9 additions & 9 deletions html.jsx → html.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,8 @@ import { link } from 'gatsby-helpers'
import { TypographyStyle } from 'utils/typography'

export default class Html extends React.Component {
propTypes () {
return {
body: React.PropTypes.string,
favicon: React.PropTypes.string,
title: React.PropTypes.string,
}
}
render () {
const { favicon, body } = this.props
let title = DocumentTitle.rewind()
if (this.props.title) {
title = this.props.title
Expand All @@ -27,7 +21,7 @@ export default class Html extends React.Component {
content="user-scalable=no width=device-width, initial-scale=1.0 maximum-scale=1.0"
/>
<title>{this.props.title}</title>
<link rel="shortcut icon" href={this.props.favicon}/>
<link rel="shortcut icon" href={favicon}/>
<TypographyStyle/>
<style
dangerouslySetInnerHTML={{
Expand All @@ -51,12 +45,18 @@ export default class Html extends React.Component {
/>
</head>
<body className="landing-page">
<div id="react-mount" dangerouslySetInnerHTML={{ __html: this.props.body }} />
<div id="react-mount" dangerouslySetInnerHTML={{ __html: body }} />
<script src={link('/bundle.js')}/>
</body>
</html>
)
}
}

Html.propTypes = {
body: React.PropTypes.string,
favicon: React.PropTypes.string,
title: React.PropTypes.string,
}

Html.defaultProps = { body: '' }
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "n/a",
"scripts": {
"lint": "./node_modules/.bin/eslint --ext .js,.jsx --ignore-pattern public .",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "gatsby develop"
},
"repository": {
"type": "git",
Expand All @@ -22,21 +23,21 @@
"homepage": "https://github.com/gatsbyjs/gatsby-starter-blog#readme",
"dependencies": {
"lodash": "^4.5.0",
"moment": "^2.10.3",
"moment": "^2.11.2",
"react": "^0.14.7",
"react-document-title": "^2.0.1",
"react-dom": "^0.14.7",
"react-responsive-grid": "^0.3.0",
"react-responsive-grid": "^0.3.1",
"react-router": "^2.0.0",
"safe-access": "^0.1.0",
"typography": "^0.7.0",
"underscore.string": "^3.2.2"
"underscore.string": "^3.2.3"
},
"devDependencies": {
"babel-plugin-react-transform": "^1.1.1",
"eslint": "^1.10.3",
"eslint-config-airbnb": "^5.0.1",
"eslint-plugin-react": "^4.0.0",
"eslint-plugin-react": "^3.16.1",
"react-transform-catch-errors": "^1.0.0",
"react-transform-hmr": "^1.0.0",
"redbox-react": "^1.0.1"
Expand Down
5 changes: 3 additions & 2 deletions pages/_template.jsx → pages/_template.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import '../css/styles.css'

class Template extends React.Component {
render () {
const { location, children } = this.props
let header
if (this.props.location.pathname === link('/')) {
if (location.pathname === link('/')) {
header = (
<h1
style={{
Expand Down Expand Up @@ -53,7 +54,7 @@ class Template extends React.Component {
}}
>
{header}
{this.props.children}
{children}
</Container>
)
}
Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions wrappers/md.jsx → wrappers/md.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import '../css/zenburn.css'

class MarkdownWrapper extends React.Component {
render () {
const post = this.props.route.page.data
const { route } = this.props
const post = route.page.data

return (
<DocumentTitle title={`${post.title} | ${config.blogTitle}`}>
Expand All @@ -30,7 +31,7 @@ class MarkdownWrapper extends React.Component {
marginBottom: rhythm(2),
}}
/>
<ReadNext post={post} pages={this.props.route.pages} />
<ReadNext post={post} pages={route.pages} />
<p>
<img
src={link('/kyle-round-small-pantheon.jpg')}
Expand Down

0 comments on commit d70ecc1

Please sign in to comment.