From f0b191a3358a5645d4fa1da2efc7b8b29391b6e9 Mon Sep 17 00:00:00 2001 From: Nat Alison Date: Tue, 18 Feb 2020 10:06:18 -0800 Subject: [PATCH] fix(www): add back frontmatter to fix prev and next (#21559) * add back frontmatter to fix prev and next * remove comment --- www/src/templates/template-blog-post.js | 15 +-------------- www/src/utils/node/docs.js | 11 +++++++++-- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/www/src/templates/template-blog-post.js b/www/src/templates/template-blog-post.js index a24737cf78bd5..cbec0e4ba8070 100644 --- a/www/src/templates/template-blog-post.js +++ b/www/src/templates/template-blog-post.js @@ -226,20 +226,7 @@ class BlogPostTemplate extends React.Component { }} > - + diff --git a/www/src/utils/node/docs.js b/www/src/utils/node/docs.js index e81ade29f5706..4d0bba4a55b41 100644 --- a/www/src/utils/node/docs.js +++ b/www/src/utils/node/docs.js @@ -55,6 +55,7 @@ exports.createPages = async ({ graphql, actions }) => { released } frontmatter { + title draft canonicalLink publishedAt @@ -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, + }, }, }) })