Category : gatsby

I wish to place a list of posts on my home page instead of having to create a seperate dynamic page. This is my gatsby-node.js file // DYNAMICALLY CREATE PAGES FOR EACH POST module.exports.createPages = async ({ graphql, actions, reporter }) => { const { createPage } = actions; const postTemplate = path.resolve(‘src/templates/news.js’); const postResult ..

Read more

I am trying to optimize images using gatsby-image-plugin. I have a HomePageBanner node with an array of images (node.gallery). I tried to loop the gallery images to createRemoteFileNode. // gatsby-node.js exports.onCreateNode = async ({ node, actions: { createNode }, store, cache, createNodeId, }) => { if (node.internal.type === "HomePageBanner") { const files = await node.gallery.reduce(async ..

Read more