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
This commit is contained in:
Sylvain BRUAS 2024-04-23 22:04:51 +02:00 committed by GitHub
parent c2914069da
commit 6bd7bc07e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -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',