gatsby-attainlabs-cms 1.0.37 → 1.0.39
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.
- package/gatsby-node.js +4 -57
- package/package.json +1 -1
package/gatsby-node.js
CHANGED
|
@@ -38,6 +38,7 @@ const generatePage = async (blocks, layout, isNested) => {
|
|
|
38
38
|
title={meta ? meta.title : ""}
|
|
39
39
|
description={meta ? meta.description : ""}
|
|
40
40
|
noIndex={true}
|
|
41
|
+
data={blocks}
|
|
41
42
|
/>
|
|
42
43
|
);
|
|
43
44
|
};
|
|
@@ -51,6 +52,7 @@ const generatePage = async (blocks, layout, isNested) => {
|
|
|
51
52
|
};
|
|
52
53
|
|
|
53
54
|
export default Page;
|
|
55
|
+
|
|
54
56
|
`;
|
|
55
57
|
|
|
56
58
|
// Format the generated code using Prettier (must await!)
|
|
@@ -473,7 +475,7 @@ exports.sourceNodes = async (
|
|
|
473
475
|
const allBlogs = getAllBlogs(firebaseData);
|
|
474
476
|
|
|
475
477
|
for (const blog of allBlogs) {
|
|
476
|
-
const id = createNodeId(`
|
|
478
|
+
const id = createNodeId(`attain-cms-blog-${blog.id}`);
|
|
477
479
|
const node = {
|
|
478
480
|
...blog,
|
|
479
481
|
id,
|
|
@@ -481,7 +483,7 @@ exports.sourceNodes = async (
|
|
|
481
483
|
parent: null,
|
|
482
484
|
children: [],
|
|
483
485
|
internal: {
|
|
484
|
-
type: "
|
|
486
|
+
type: "AttainLabsCmsBlogs",
|
|
485
487
|
contentDigest: createContentDigest(blog),
|
|
486
488
|
},
|
|
487
489
|
};
|
|
@@ -599,62 +601,7 @@ exports.createPages = async ({ actions, store }, pluginOptions) => {
|
|
|
599
601
|
}
|
|
600
602
|
}
|
|
601
603
|
|
|
602
|
-
// async function processBlogs(page, parentPath = "") {
|
|
603
|
-
// if (page.template === "visual-editor" && page.published && page.type === "blog") {
|
|
604
|
-
// const {
|
|
605
|
-
// blocks: {
|
|
606
|
-
// content,
|
|
607
|
-
// root: {
|
|
608
|
-
// props: { pageUrl, layout },
|
|
609
|
-
// },
|
|
610
|
-
// },
|
|
611
|
-
// id,
|
|
612
|
-
// folderNumber,
|
|
613
|
-
// parentFolder
|
|
614
|
-
// } = page;
|
|
615
|
-
|
|
616
|
-
// // Create slice for each block
|
|
617
|
-
// await Promise.all(
|
|
618
|
-
// content.map(async (b) => {
|
|
619
|
-
// const name = b.props.component.name;
|
|
620
|
-
// const sliceId = `block--${pageUrl}--${name}--${id}--${crypto.randomUUID()}`;
|
|
621
|
-
|
|
622
|
-
// createSlice({
|
|
623
|
-
// id: sliceId,
|
|
624
|
-
// component: path.resolve(
|
|
625
|
-
// siteRoot,
|
|
626
|
-
// "src/cms/components/sliceWrapper.tsx"
|
|
627
|
-
// ),
|
|
628
|
-
// context: {
|
|
629
|
-
// componentPath: `./src/cms/components${b.props.component.path}/index.tsx`,
|
|
630
|
-
// ...b.props,
|
|
631
|
-
// },
|
|
632
|
-
// });
|
|
633
|
-
|
|
634
|
-
// b["sliceId"] = sliceId;
|
|
635
|
-
// return b;
|
|
636
|
-
// })
|
|
637
|
-
// );
|
|
638
|
-
|
|
639
|
-
// // Generate page file
|
|
640
|
-
// const pageSource = await generateBlogPage(content, layout, parentPath);
|
|
641
|
-
// const folderPath = pageUrl;
|
|
642
|
-
// const outPath = path.join(siteRoot, "src/cms/pages", `${parentFolder}/${folderNumber}/${folderPath}.tsx`);
|
|
643
|
-
|
|
644
|
-
// await fse.outputFile(outPath, pageSource);
|
|
645
|
-
|
|
646
|
-
// await createPage({
|
|
647
|
-
// path: `${parentFolder}/${folderNumber}/${folderPath}`,
|
|
648
|
-
// component: outPath,
|
|
649
|
-
// context: { ...page },
|
|
650
|
-
// });
|
|
651
|
-
// }
|
|
652
|
-
// }
|
|
653
|
-
|
|
654
604
|
for (const page of Object.values(firebaseJson)) {
|
|
655
605
|
await processPage(page);
|
|
656
606
|
}
|
|
657
|
-
// for (const blog of blogsWithFolderNumbers) {
|
|
658
|
-
// await processBlogs(blog, brand === "LendDirect" ? "resources" : "blogs");
|
|
659
|
-
// }
|
|
660
607
|
};
|