gatsby-attainlabs-cms 1.0.28 → 1.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/gatsby-node.js +5 -4
  2. package/package.json +1 -1
package/gatsby-node.js CHANGED
@@ -27,13 +27,12 @@ const generatePage = async (blocks, layout, isNested) => {
27
27
  const pageContent = `
28
28
  /* This is a generated file by the gatsby-attainlabs-cms plugin. Any changes will be overwritten on the next build. */
29
29
  import { Slice } from "gatsby";
30
- import SEO from "../${isNested && "../"}components/SEO";
31
- import Layout from "../${isNested && "../"}layouts/${layout}";
30
+ import SEO from "../${isNested && "../"}components/SEO";
32
31
 
33
32
 
34
33
 
35
34
  export const Head = ({ pageContext }: any) => {
36
- const blocks = pageContext.blocks || { root: { props: { meta: {} } } };
35
+ const blocks = pageContext.blocks || { root: { props: { meta: { title: "", description: "", image: "", keywords: ""} } } };
37
36
  const { title, description } = blocks.root.props.meta;
38
37
  return <SEO title={title} description={description} noIndex={true} />;
39
38
  };
@@ -512,7 +511,9 @@ exports.createPages = async ({ actions, store }, pluginOptions) => {
512
511
  await fse.outputFile(outPath, pageSource);
513
512
 
514
513
  await createPage({
515
- path: folderPath === "index" ? `/` : `/${folderPath}`,
514
+ path: folderPath.endsWith("/index")
515
+ ? `/${parentPath}`
516
+ : `/${folderPath}`,
516
517
  component: outPath,
517
518
  context: { ...page },
518
519
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-attainlabs-cms",
3
- "version": "1.0.28",
3
+ "version": "1.0.30",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",