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
|
|
@ -4,13 +4,14 @@ Router = require 'react-router'
|
|||
{Container, Grid, Breakpoint, Span} = require 'react-responsive-grid'
|
||||
Typography = require 'typography'
|
||||
require '../css/styles.css'
|
||||
{link} = require 'gatsby-helpers'
|
||||
|
||||
typography = Typography()
|
||||
{rhythm, fontSizeToMS} = typography
|
||||
|
||||
module.exports = React.createClass
|
||||
render: ->
|
||||
if @props.state.path is "/"
|
||||
if @props.state.path is link('/')
|
||||
header = (
|
||||
<h1
|
||||
style={{
|
||||
|
|
@ -24,7 +25,7 @@ module.exports = React.createClass
|
|||
textDecoration: 'none'
|
||||
color: 'inherit'
|
||||
}}
|
||||
to="/"
|
||||
to={link('/')}
|
||||
>
|
||||
{@props.config.blogTitle}
|
||||
</Link>
|
||||
|
|
@ -38,7 +39,7 @@ module.exports = React.createClass
|
|||
textDecoration: 'none'
|
||||
color: 'inherit'
|
||||
}}
|
||||
to="/"
|
||||
to={link('/')}
|
||||
>
|
||||
{@props.config.blogTitle}
|
||||
</Link>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
React = require 'react'
|
||||
Router = require 'react-router'
|
||||
{RouteHandler, Link} = Router
|
||||
sortBy = require 'lodash/collection/sortby'
|
||||
sortBy = require 'lodash/collection/sortBy'
|
||||
{link} = require 'gatsby-helpers'
|
||||
|
||||
module.exports = React.createClass
|
||||
statics:
|
||||
|
|
@ -13,7 +14,7 @@ module.exports = React.createClass
|
|||
pageLinks = []
|
||||
for page in sortBy(@props.pages, (page) -> page.data?.date).reverse()
|
||||
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 (
|
||||
<li
|
||||
key={page.path}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue