diff --git a/plugins/gatsby-plugin-embed-pages/gatsby-node.js b/plugins/gatsby-plugin-embed-pages/gatsby-node.js index 8bb1eea9e..7aaa1f369 100644 --- a/plugins/gatsby-plugin-embed-pages/gatsby-node.js +++ b/plugins/gatsby-plugin-embed-pages/gatsby-node.js @@ -13,7 +13,6 @@ exports.createPages = async ({ actions, graphql, reporter }) => { } frontmatter { title - path redirects } } @@ -23,13 +22,10 @@ exports.createPages = async ({ actions, graphql, reporter }) => { data.allMdx.nodes.forEach((node) => { const { - frontmatter, + frontmatter: { redirects }, fields: { fileRelativePath, slug }, } = node; - const { redirects } = frontmatter; - const nodePath = frontmatter.path || slug; - const pagePath = path.join(nodePath, 'embed', '/'); - const contentSourcePath = nodePath; + const pagePath = path.join(slug, 'embed', '/'); createPage({ path: pagePath, @@ -37,7 +33,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => { context: { slug, fileRelativePath, - contentSourcePath, + contentSourcePath: slug, layout: 'EmbedLayout', }, });