From 6c2edf6656849b8b4ae8722f76aa7ea2487618cf Mon Sep 17 00:00:00 2001 From: Imran Date: Sun, 15 Nov 2020 17:45:34 +0530 Subject: [PATCH] Add update posts --- package.json | 2 +- packages/gatsby-woocommerce-theme/create-pages/posts.js | 6 +++--- packages/gatsby-woocommerce-theme/package.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index ec891e55..66c060fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gatsby-woocommerce-themes", - "version": "1.0.3", + "version": "1.0.4", "private": true, "description": "Gatsby WooCommerce Theme Project", "main": "index.js", diff --git a/packages/gatsby-woocommerce-theme/create-pages/posts.js b/packages/gatsby-woocommerce-theme/create-pages/posts.js index 8428b965..0905a12c 100644 --- a/packages/gatsby-woocommerce-theme/create-pages/posts.js +++ b/packages/gatsby-woocommerce-theme/create-pages/posts.js @@ -51,7 +51,7 @@ module.exports = async ( { actions, graphql } ) => { const { posts, categories } = data; - return { posts: posts?.nodes, categoriesData: categories?.nodes }; + return { posts: posts.nodes, categoriesData: categories.nodes }; } ); }; @@ -63,10 +63,10 @@ module.exports = async ( { actions, graphql } ) => { posts.map( ( post ) => { // If its not a custom template, create the page. - if ( ! customTemplatesUris.includes( post?.uri ) &&! customTemplateSlugs.includes( post?.slug ) ) { + if ( ! customTemplatesUris.includes( post.uri ) &&! customTemplateSlugs.includes( post.slug ) ) { createPage( { - path: `${ post?.uri }`, + path: `${ post.uri }`, component: slash( singlePostTemplate ), context: { ...post, categoriesData }, // pass single page data in context, so its available in the singlePostTemplate in props.pageContext. } ); diff --git a/packages/gatsby-woocommerce-theme/package.json b/packages/gatsby-woocommerce-theme/package.json index 1b5ae139..18e4c873 100644 --- a/packages/gatsby-woocommerce-theme/package.json +++ b/packages/gatsby-woocommerce-theme/package.json @@ -1,6 +1,6 @@ { "name": "gatsby-woocommerce-theme", - "version": "1.0.3", + "version": "1.0.4", "description": "Gatsby WooCommerce Theme - Electra", "main": "index.js", "author": "Imran Sayed",