Update blog to work with new gatsby-helpers + work on github pages
This commit is contained in:
parent
8019569f69
commit
2286041789
3 changed files with 8 additions and 5 deletions
|
|
@ -1,2 +1,3 @@
|
||||||
blogTitle = "My Awesome Blog"
|
blogTitle = "My Awesome Blog"
|
||||||
authorName = "Kyle Mathews"
|
authorName = "Kyle Mathews"
|
||||||
|
ghPagesURLPrefix = "/gatsby-starter-blog"
|
||||||
|
|
|
||||||
|
|
@ -4,13 +4,14 @@ Router = require 'react-router'
|
||||||
{Container, Grid, Breakpoint, Span} = require 'react-responsive-grid'
|
{Container, Grid, Breakpoint, Span} = require 'react-responsive-grid'
|
||||||
Typography = require 'typography'
|
Typography = require 'typography'
|
||||||
require '../css/styles.css'
|
require '../css/styles.css'
|
||||||
|
{link} = require 'gatsby-helpers'
|
||||||
|
|
||||||
typography = Typography()
|
typography = Typography()
|
||||||
{rhythm, fontSizeToMS} = typography
|
{rhythm, fontSizeToMS} = typography
|
||||||
|
|
||||||
module.exports = React.createClass
|
module.exports = React.createClass
|
||||||
render: ->
|
render: ->
|
||||||
if @props.state.path is "/"
|
if @props.state.path is link('/')
|
||||||
header = (
|
header = (
|
||||||
<h1
|
<h1
|
||||||
style={{
|
style={{
|
||||||
|
|
@ -24,7 +25,7 @@ module.exports = React.createClass
|
||||||
textDecoration: 'none'
|
textDecoration: 'none'
|
||||||
color: 'inherit'
|
color: 'inherit'
|
||||||
}}
|
}}
|
||||||
to="/"
|
to={link('/')}
|
||||||
>
|
>
|
||||||
{@props.config.blogTitle}
|
{@props.config.blogTitle}
|
||||||
</Link>
|
</Link>
|
||||||
|
|
@ -38,7 +39,7 @@ module.exports = React.createClass
|
||||||
textDecoration: 'none'
|
textDecoration: 'none'
|
||||||
color: 'inherit'
|
color: 'inherit'
|
||||||
}}
|
}}
|
||||||
to="/"
|
to={link('/')}
|
||||||
>
|
>
|
||||||
{@props.config.blogTitle}
|
{@props.config.blogTitle}
|
||||||
</Link>
|
</Link>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
React = require 'react'
|
React = require 'react'
|
||||||
Router = require 'react-router'
|
Router = require 'react-router'
|
||||||
{RouteHandler, Link} = Router
|
{RouteHandler, Link} = Router
|
||||||
sortBy = require 'lodash/collection/sortby'
|
sortBy = require 'lodash/collection/sortBy'
|
||||||
|
{link} = require 'gatsby-helpers'
|
||||||
|
|
||||||
module.exports = React.createClass
|
module.exports = React.createClass
|
||||||
statics:
|
statics:
|
||||||
|
|
@ -13,7 +14,7 @@ module.exports = React.createClass
|
||||||
pageLinks = []
|
pageLinks = []
|
||||||
for page in sortBy(@props.pages, (page) -> page.data?.date).reverse()
|
for page in sortBy(@props.pages, (page) -> page.data?.date).reverse()
|
||||||
title = page.data?.title || page.path
|
title = page.data?.title || page.path
|
||||||
if page.path isnt "/" and not page.data?.draft
|
if page.path isnt link("/") and not page.data?.draft
|
||||||
pageLinks.push (
|
pageLinks.push (
|
||||||
<li
|
<li
|
||||||
key={page.path}
|
key={page.path}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue