-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[v2] upgrade using-remark example site (#5220)
* Upgrade using remark example site to v2 * Update remark dependencies
- Loading branch information
1 parent
72f28a1
commit 765b679
Showing
15 changed files
with
315 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,74 @@ | ||
import React from "react" | ||
import { Link } from "gatsby" | ||
import { rhythm, scale } from "../utils/typography" | ||
import { Link, StaticQuery } from "gatsby" | ||
import typography from "../utils/typography" | ||
import styles from "../styles" | ||
|
||
import "typeface-space-mono" | ||
import "typeface-spectral" | ||
|
||
require(`prismjs/themes/prism-solarizedlight.css`) | ||
import "prismjs/themes/prism-solarizedlight.css" | ||
|
||
class DefaultLayout extends React.Component { | ||
const { scale } = typography | ||
|
||
class Layout extends React.Component { | ||
render() { | ||
const { author, homepage } = this.props.data.site.siteMetadata | ||
return ( | ||
<div> | ||
<div {...styles.container} {...styles.verticalPadding}> | ||
<Link | ||
to="/" | ||
css={{ | ||
display: `inline-block`, | ||
textDecoration: `none`, | ||
}} | ||
> | ||
<h1 | ||
css={{ | ||
...scale(0), | ||
color: styles.colors.light, | ||
fontWeight: `normal`, | ||
lineHeight: 1, | ||
margin: 0, | ||
}} | ||
> | ||
gatsby-example-using-remark | ||
</h1> | ||
</Link> | ||
</div> | ||
<div {...styles.container} {...styles.verticalPadding}> | ||
{this.props.children()} | ||
<div | ||
css={{ | ||
...scale(-0.5), | ||
color: styles.colors.light, | ||
}} | ||
> | ||
powered by{` `} | ||
<a target="_blank" href={homepage}> | ||
{author} | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
<StaticQuery | ||
query={graphql` | ||
query LayoutIndexQuery { | ||
site { | ||
siteMetadata { | ||
author | ||
homepage | ||
} | ||
} | ||
} | ||
`} | ||
render={data => { | ||
const { author, homepage } = data.site.siteMetadata | ||
return ( | ||
<div> | ||
<div {...styles.container} {...styles.verticalPadding}> | ||
<Link | ||
to="/" | ||
css={{ | ||
display: `inline-block`, | ||
textDecoration: `none`, | ||
}} | ||
> | ||
<h1 | ||
css={{ | ||
...scale(0), | ||
color: styles.colors.light, | ||
fontWeight: `normal`, | ||
lineHeight: 1, | ||
margin: 0, | ||
}} | ||
> | ||
gatsby-example-using-remark | ||
</h1> | ||
</Link> | ||
</div> | ||
<div {...styles.container} {...styles.verticalPadding}> | ||
{this.props.children} | ||
<div | ||
css={{ | ||
...scale(-0.5), | ||
color: styles.colors.light, | ||
}} | ||
> | ||
powered by{` `} | ||
<a target="_blank" href={homepage}> | ||
{author} | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
}} | ||
/> | ||
) | ||
} | ||
} | ||
|
||
export default DefaultLayout | ||
|
||
export const pageQuery = graphql` | ||
query LayoutIndexQuery { | ||
site { | ||
siteMetadata { | ||
author | ||
homepage | ||
} | ||
} | ||
} | ||
` | ||
export default Layout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.