Skip to content

Commit

Permalink
Add update posts
Browse files Browse the repository at this point in the history
  • Loading branch information
imranhsayed committed Nov 15, 2020
1 parent ec9125e commit 6c2edf6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
6 changes: 3 additions & 3 deletions packages/gatsby-woocommerce-theme/create-pages/posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
} );
};

Expand All @@ -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.
} );
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-woocommerce-theme/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 6c2edf6

Please sign in to comment.