Fix layout filename
This commit is contained in:
parent
67de95ba5a
commit
18caedf7f9
1 changed files with 71 additions and 0 deletions
71
src/components/Layout.js
Normal file
71
src/components/Layout.js
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
import React from 'react'
|
||||
import { Link } from 'gatsby'
|
||||
|
||||
import { rhythm, scale } from '../utils/typography'
|
||||
|
||||
class Layout extends React.Component {
|
||||
render() {
|
||||
const { location, children } = this.props
|
||||
const rootPath = `${__PATH_PREFIX__}/`
|
||||
let header
|
||||
|
||||
if (location.pathname === rootPath) {
|
||||
header = (
|
||||
<h1
|
||||
style={{
|
||||
...scale(1.5),
|
||||
marginBottom: rhythm(1.5),
|
||||
marginTop: 0,
|
||||
}}
|
||||
>
|
||||
<Link
|
||||
style={{
|
||||
boxShadow: 'none',
|
||||
textDecoration: 'none',
|
||||
color: 'inherit',
|
||||
}}
|
||||
to={'/'}
|
||||
>
|
||||
Gatsby Starter Blog
|
||||
</Link>
|
||||
</h1>
|
||||
)
|
||||
} else {
|
||||
header = (
|
||||
<h3
|
||||
style={{
|
||||
fontFamily: 'Montserrat, sans-serif',
|
||||
marginTop: 0,
|
||||
marginBottom: rhythm(-1),
|
||||
}}
|
||||
>
|
||||
<Link
|
||||
style={{
|
||||
boxShadow: 'none',
|
||||
textDecoration: 'none',
|
||||
color: 'inherit',
|
||||
}}
|
||||
to={'/'}
|
||||
>
|
||||
Gatsby Starter Blog
|
||||
</Link>
|
||||
</h3>
|
||||
)
|
||||
}
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
marginLeft: 'auto',
|
||||
marginRight: 'auto',
|
||||
maxWidth: rhythm(24),
|
||||
padding: `${rhythm(1.5)} ${rhythm(3 / 4)}`,
|
||||
}}
|
||||
>
|
||||
{header}
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default Layout
|
||||
Loading…
Add table
Add a link
Reference in a new issue