Skip to content

Commit

Permalink
fix(www): Blog posts not rendering (gatsbyjs#14236)
Browse files Browse the repository at this point in the history
* fix(www): markdownRemark is undefined

…because we switched to MDX (gatsbyjs#12514)

* this.props.data.mdx -> post
  • Loading branch information
fk authored and DSchau committed May 22, 2019
1 parent dc33182 commit 5d3ff9a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions www/src/templates/template-blog-post.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class BlogPostTemplate extends React.Component {
render() {
const {
pageContext: { prev, next },
data: { markdownRemark: post },
data: { mdx: post },
location: { href },
} = this.props
const prevNextLinkStyles = {
Expand Down Expand Up @@ -187,7 +187,7 @@ class BlogPostTemplate extends React.Component {
(originally published at
{` `}
<a href={post.frontmatter.canonicalLink}>
{this.props.data.mdx.fields.publishedAt}
{post.fields.publishedAt}
</a>
)
</span>
Expand All @@ -201,7 +201,7 @@ class BlogPostTemplate extends React.Component {
[mediaQueries.lg]: { marginBottom: rhythm(5 / 4) },
}}
>
{this.props.data.mdx.frontmatter.title}
{post.frontmatter.title}
</h1>
{post.frontmatter.image &&
!(post.frontmatter.showImageInArticle === false) && (
Expand All @@ -220,9 +220,9 @@ class BlogPostTemplate extends React.Component {
</div>
)}
<section className="post-body">
<MDXRenderer>{this.props.data.mdx.body}</MDXRenderer>
<MDXRenderer>{post.body}</MDXRenderer>
</section>
<TagsSection tags={this.props.data.mdx.frontmatter.tags} />
<TagsSection tags={post.frontmatter.tags} />
<EmailCaptureForm />
</main>
</Container>
Expand Down

0 comments on commit 5d3ff9a

Please sign in to comment.