Skip to content

Commit

Permalink
fix(www): add back frontmatter to fix prev and next (#21559)
Browse files Browse the repository at this point in the history
* add back frontmatter to fix prev and next

* remove comment
  • Loading branch information
tesseralis authored Feb 18, 2020
1 parent 9884cd8 commit f0b191a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
15 changes: 1 addition & 14 deletions www/src/templates/template-blog-post.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,20 +226,7 @@ class BlogPostTemplate extends React.Component {
}}
>
<Container>
<PrevAndNext
prev={
prev && {
title: prev.frontmatter.title,
link: prev.fields.slug,
}
}
next={
next && {
title: next.frontmatter.title,
link: next.fields.slug,
}
}
/>
<PrevAndNext prev={prev} next={next} />
</Container>
<FooterLinks />
</div>
Expand Down
11 changes: 9 additions & 2 deletions www/src/utils/node/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ exports.createPages = async ({ graphql, actions }) => {
released
}
frontmatter {
title
draft
canonicalLink
publishedAt
Expand Down Expand Up @@ -122,8 +123,14 @@ exports.createPages = async ({ graphql, actions }) => {
component: slash(blogPostTemplate),
context: {
slug: node.fields.slug,
prev,
next,
prev: prev && {
title: prev.frontmatter.title,
link: prev.fields.slug,
},
next: next && {
title: next.frontmatter.title,
link: next.fields.slug,
},
},
})
})
Expand Down

0 comments on commit f0b191a

Please sign in to comment.