From 6bd7bc07e4f8140cac4e02bc71c42f6e6591e792 Mon Sep 17 00:00:00 2001 From: Sylvain BRUAS Date: Tue, 23 Apr 2024 22:04:51 +0200 Subject: [PATCH] Update gatsby-node.js to use slug from frontmatter 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',