-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
_template.cjsx
58 lines (54 loc) · 1.31 KB
/
_template.cjsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
React = require 'react'
Router = require 'react-router'
{RouteHandler, Link} = 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 link('/')
header = (
<h1
style={{
fontSize: fontSizeToMS(2.5).fontSize
lineHeight: fontSizeToMS(2.5).lineHeight
marginBottom: rhythm(1.5)
}}
>
<Link
style={{
textDecoration: 'none'
color: 'inherit'
}}
to={link('/')}
>
{@props.config.blogTitle}
</Link>
</h1>
)
else
header = (
<h3>
<Link
style={{
textDecoration: 'none'
color: 'inherit'
}}
to={link('/')}
>
{@props.config.blogTitle}
</Link>
</h3>
)
<Container
style={{
maxWidth: rhythm(24)
padding: "#{rhythm(2)} #{rhythm(1/2)}"
}}
>
{header}
<RouteHandler typography={typography} {...@props}/>
</Container>