News Articles gatsby

Struggling with map function in gatsby

I am trying to organise some data into my gatsby front end, the data is being pulled through GraphQL from a Contentful CMS; the I can see the data object but I am having a hard time mapping through this: return <Layout> <SEO title="Page two" /> <h1>This is our work page</h1> <p>Here are examples of […]

Embedding widget to Gatsby.js website

I’m trying to add a widget to a Gatsby site, but it does not render. I’ve tried using react Helmet for the <script> part, but it still does not work. Hopefully I’m missing something simple here, but looking at other solutions I can’t find anything that works. For reference: <script type="text/javascript" src=""></script> <div […]

Is there a way in Gatsby to export inlined styled components CSS into a CSS file?

Dear Stack Overflow wizards, I have accomplished my first Gatsby app, which will be going to production soon. Here’s the link: I have used styled components throughout the app, I usually take the SCSS with BEM approach, but I wanted to try this CSS in JS approach. The issue is that the page first […]

Native Search vs. Jetpack Instant Search in Headless WordPress With Gatsby

Have you already tried using WordPress headlessly with Gatsby? If you haven’t, you might check this article around the new Gatsby source plugin for WordPress; gatsby-source-wordpress is the official source plugin introduced in March 2021 as a part of the Gatsby 3 release. It significantly improves the integration with WordPress. Also, the WordPress plugin WPGraphQL […]

How can I easily deploy React and Gastby to github-pages using Github’s worflow?

I’m trying to create a workflow so whenever I push code to my main branch, it automatically do npm run deploy so my github pages website is always up to date with the main branch. My app is a react and gatsby app but I can’t find a way to make a workflow to do […]

Using client-only routes with page templates coming from Contentful

Goal I am looking to use client-only routes for content under a certain URL (/dashboard). Some of this content will be coming from Contentful and using a page template. An example of this route would be {MYDOMAIN}/dashboard/{SLUG_FROM_CONTENTFUL}. The purpose of this is to ensure projects I have worked on at an agency are not able […]

issue with css rules overstruck when in production

I have a gatsby project and an image that should be visible on desktop and not visible when on mobile. This is part of my component code: <StaticImage src="../assets/images/undraw_Code_review_re_woeb.svg" alt="portfolio" className="hero-img" placeholder="blurred" /> These are my css rules: .hero-img { display: none; } @media screen and (min-width: 992px) { .hero-img { display: block; grid-row: 1/1; […]

Gastby js deployment to SSH server using Github action.

This is a simple code snippet that shows how you can deploy you Gatsby.js application to an SSH server using Github actions. Create a main.yaml in your .github/workflow name: blog on: push: branches: main jobs: build-and-deploy: name: Build and deploy Gatsby site runs-on: ubuntu-latest steps: – name: Checkout Code uses: actions/[email protected] – name: Install Node.js […]

Gatsby Pop up Install application on PWA React

Is there anyone who know how can I implement a pop up to install my app when I load the app for the first time. It is already in PWA because I’m seeing an install button on the search bar of my browser. What I want to do is have a pop up so users […]

Pop up Install application on PWA React

Hello I’m is there anyone who know how can I implement a pop up to install my app when I load the app for the first time. It is already in PWA because I’m seeing an install button on the search bar of my browser. What I want to do is have a pop up […]

Error while using Location prop in Gatsby Helmet

I’d like to add a class to the body tag containing the pathname. I think I should have access to the location prop and that I should be able to pass this. However location is being passed as null. I’m using this as a resource : /** * SEO component that queries for data […]

how to translate this javascript code into JSX GATSBY react

so i have this javascript code that i want to use in GATSBY react, its working so far, so this is what i got, first of all THIS IS MY JAVASCRIPT CODE the one that i want to turn into GATSBY react JSX function onLoad() { var showDiv; if(localStorage.getItem ("showDiv") == null) { showDiv = […]

React (Gatsby) – npm package Elevio problems

I am trying to implement Elevio into my React project and am following the documentation here After running npm i and inserting this piece of code <div> <Elevio accountId="account-id" /> </div> my project crashes and gives me this error Module not found: Error: package path ./lib/react is not exported from package Any help is […]

Display images with a loop in a React component

I am using Gatbyjs, and I would like to display multiple images in a card component. It seems that this solution shoud work, but it does not. I don’t get any other specific error than: GEThttp://localhost:8000/[object Module] [HTTP/1.1 404 Not Found 13ms] I tried to use an absolute path for the src attribute and it […]


hello there so im very confused with JSX and i need help people, this is what i got so far . . . THIS IS MY COMPONENT import React from ‘react’; import ‘../index.css’ const Com = () => { document.querySelector (‘.contenedor’).style.opacity = "0.5"; return ( <div className="contenedor"> <img className="portada" src="" alt=""/> </div> ); } export […]

Gatsby JS Backend?

I have recently been tasked with enabling users to save their data on a website. Website is built with Gatsby. The website is basically a quiz/game where users receive a score at the end of their session. Unfortunately, the data and score is gone once the page is changed, reloaded or closed. I was wondering […]

SEO internal and external links problem while crawl in Gatsby

In my Gatsby application, I have a dynamic screens which created through create pages which doesn’t have any links inside the screen, links will be available in the common header and [footer][1], but the crawling SEO with it shows screen has, orphan pages (no internal links), no outgoing links redirected page has no incoming […]

Adding an Updated Date to Markdown and Mdx Posts

The Problem Unlike a CMS grabbing the modified date for your posts in frameworks like Gatsby and Next can come as a bit of a challenge. In Gatsby for instance you could use the gatsby-transformer-gitinfo plugin which adds a gitPublishedDate field to your GraphQL schema, and this will work perfectly for a lot of cases. […]

Sitemap | Terms | Privacy | Cookies | Advertising

Senior Software Developer

Creator of @LzoMedia I am a backend software developer based in London who likes beautiful code and has an adherence to standards & love's open-source.