gatsby-attainlabs-cms 1.0.24 → 1.0.25
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 +6 -10
- package/package.json +1 -1
package/gatsby-node.js
CHANGED
|
@@ -384,21 +384,17 @@ exports.createPages = async ({ actions, store }, pluginOptions) => {
|
|
|
384
384
|
);
|
|
385
385
|
const firebaseJson = await firebaseData.json();
|
|
386
386
|
for (const page of Object.values(firebaseJson)) {
|
|
387
|
-
if (page.template === "visual-editor") {
|
|
388
|
-
const {
|
|
389
|
-
draft: {
|
|
387
|
+
if (page.template === "visual-editor" && page.published) {
|
|
388
|
+
const {
|
|
390
389
|
blocks: {
|
|
391
390
|
content,
|
|
392
391
|
root: {
|
|
393
392
|
props: { pageUrl, layout },
|
|
394
393
|
},
|
|
395
|
-
},
|
|
396
|
-
|
|
397
|
-
id,
|
|
398
|
-
published,
|
|
394
|
+
},
|
|
395
|
+
id,
|
|
399
396
|
} = page;
|
|
400
|
-
|
|
401
|
-
if (published) {
|
|
397
|
+
|
|
402
398
|
//Generate page's blocks slices
|
|
403
399
|
await Promise.all(
|
|
404
400
|
content.map(async (b) => {
|
|
@@ -440,7 +436,7 @@ exports.createPages = async ({ actions, store }, pluginOptions) => {
|
|
|
440
436
|
// // Generate the page itself
|
|
441
437
|
// await fse.outputFile(outPath, pageSource);
|
|
442
438
|
// console.log(`✅ Wrote page to ${outPath}`);
|
|
443
|
-
|
|
439
|
+
|
|
444
440
|
}
|
|
445
441
|
}
|
|
446
442
|
};
|