mirror of
https://github.com/kremalicious/gatsby-redirect-from.git
synced 2024-12-22 09:13:20 +01:00
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
This commit is contained in:
parent
c2914069da
commit
169ea1fed0
@ -62,7 +62,7 @@ export async function createPages({ graphql, actions }, pluginOptions) {
|
|||||||
allPosts.forEach(({ node }) => {
|
allPosts.forEach(({ node }) => {
|
||||||
let _slug
|
let _slug
|
||||||
const { redirect_from, slug } = node.frontmatter
|
const { redirect_from, slug } = node.frontmatter
|
||||||
if (!slug) _slug = node.fields?.slug
|
_slug = slug || node.fields?.slug;
|
||||||
if (!_slug) {
|
if (!_slug) {
|
||||||
console.log(
|
console.log(
|
||||||
'%c %s %c %s',
|
'%c %s %c %s',
|
||||||
|
Loading…
Reference in New Issue
Block a user