Skip to content

Commit

Permalink
Upgrade starter to 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Jul 4, 2017
1 parent e6c847d commit 6e19a82
Show file tree
Hide file tree
Showing 15 changed files with 2,500 additions and 2,281 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ node_modules
.gatsby-context.js
.sass-cache/
public/
.cache/
2 changes: 0 additions & 2 deletions config.toml

This file was deleted.

6 changes: 6 additions & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
siteMetadata: {
title: `Gatsby Default Starter`,
},
plugins: [`gatsby-plugin-react-helmet`],
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"version": "1.0.0",
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
"dependencies": {
"gatsby": "^0.12.45",
"object-assign": "^4.1.1",
"react-helmet": "^5.0.3",
"gatsby": "next",
"gatsby-link": "next",
"gatsby-plugin-react-helmet": "next",
"react-typography": "^0.15.0",
"typography": "^0.15.8",
"typography-breakpoint-constants": "^0.14.0",
Expand Down
20 changes: 0 additions & 20 deletions pages/index.js

This file was deleted.

19 changes: 0 additions & 19 deletions pages/page-2.js

This file was deleted.

File renamed without changes.
24 changes: 11 additions & 13 deletions html.js → src/html.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
import React from 'react'
import PropTypes from 'prop-types'
import Helmet from 'react-helmet'
import React from "react"
import PropTypes from "prop-types"
import Helmet from "react-helmet"

import { prefixLink } from 'gatsby-helpers'
import { TypographyStyle } from 'react-typography'
import typography from './utils/typography'
import { TypographyStyle } from "react-typography"
import typography from "./utils/typography"

const BUILD_TIME = new Date().getTime()

export default class HTML extends React.Component {
static propTypes = {
body: PropTypes.string
body: PropTypes.string,
}

render() {
const head = Helmet.rewind()

let css
if (process.env.NODE_ENV === 'production') {
if (process.env.NODE_ENV === "production") {
css = (
<style
dangerouslySetInnerHTML={{
__html: require('!raw!./public/styles.css'),
__html: require("!raw!./public/styles.css"),
}}
/>
)
Expand All @@ -36,17 +35,16 @@ export default class HTML extends React.Component {
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
{head.title.toComponent()}
{head.meta.toComponent()}
{this.props.headComponents}
<TypographyStyle typography={typography} />
{css}
</head>
<body>
<div
id="react-mount"
id="___gatsby"
dangerouslySetInnerHTML={{ __html: this.props.body }}
/>
<script src={prefixLink(`/bundle.js?t=${BUILD_TIME}`)} />
{this.props.postBodyComponents}
</body>
</html>
)
Expand Down
20 changes: 9 additions & 11 deletions pages/_template.jsx → src/layouts/index.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
import React from 'react'
import PropTypes from 'prop-types'
import { Link } from 'react-router'
import { prefixLink } from 'gatsby-helpers'
import Helmet from 'react-helmet'
import { config } from 'config'
import { rhythm } from '../utils/typography'
import React from "react"
import PropTypes from "prop-types"
import Link from "gatsby-link"
import Helmet from "react-helmet"
import { rhythm } from "../utils/typography"

export default class Template extends React.Component {
static propTypes = {
children: PropTypes.any
children: PropTypes.func,
}

render() {
return (
<div>
<Helmet
title={config.siteTitle}
title="Gatsby Default Starter"
meta={[
{ name: "description", content: "Sample" },
{ name: "keywords", content: "sample, something" },
Expand All @@ -36,7 +34,7 @@ export default class Template extends React.Component {
>
<h1 style={{ margin: 0 }}>
<Link
to={prefixLink("/")}
to="/"
style={{
color: "white",
textDecoration: "none",
Expand All @@ -55,7 +53,7 @@ export default class Template extends React.Component {
paddingTop: 0,
}}
>
{this.props.children}
{this.props.children()}
</div>
</div>
)
Expand Down
File renamed without changes.
16 changes: 16 additions & 0 deletions src/pages/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from "react"
import Link from "gatsby-link"
import Helmet from "react-helmet"

export default class Index extends React.Component {
render() {
return (
<div>
<h1>Hi people</h1>
<p>Welcome to your new Gatsby site.</p>
<p>Now go build something great.</p>
<Link to="/page-2/">Go to page 2</Link>
</div>
)
}
}
15 changes: 15 additions & 0 deletions src/pages/page-2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from "react"
import Link from "gatsby-link"
import Helmet from "react-helmet"

export default class Index extends React.Component {
render() {
return (
<div>
<h1>Hi people</h1>
<p>Welcome to page 2</p>
<Link to="/">Go back to the homepage</Link>
</div>
)
}
}
File renamed without changes.
22 changes: 0 additions & 22 deletions wrappers/md.js

This file was deleted.

Loading

0 comments on commit 6e19a82

Please sign in to comment.