From 169ea1fed0f3ac2c036a15d43b6013d13487ff3a Mon Sep 17 00:00:00 2001 From: Sylvain BRUAS Date: Fri, 7 Jun 2024 15:43:42 +0200 Subject: [PATCH] Update gatsby-node.js to use slug from frontmatter (#448) update line 65 : the previous code did not use slug to set _slug variable. So the frontmatter slug value was not used even if it was set --- src/gatsby-node.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gatsby-node.js b/src/gatsby-node.js index 4fc3176..d4f6e7f 100644 --- a/src/gatsby-node.js +++ b/src/gatsby-node.js @@ -62,7 +62,7 @@ export async function createPages({ graphql, actions }, pluginOptions) { allPosts.forEach(({ node }) => { let _slug const { redirect_from, slug } = node.frontmatter - if (!slug) _slug = node.fields?.slug + _slug = slug || node.fields?.slug; if (!_slug) { console.log( '%c %s %c %s',