Nikola Đuza
Aug 14, 2020 ⋅ 13 min read

Creating a Gatsby blog from scratch

Nikola Đuza Nikola is an engineer and a writer who lives and works in Novi Sad, spreading knowledge to folks through blogging and talking. He likes to build awesome things with mostly JavaScript and Ruby. You can find out more about him on pragmaticpineapple.com.

Recent posts:

Developing Web Extensions With Wxt

Developing web extensions with the WXT library

Browser extensions are an important part of the web ecosystem. They make our lives easier and enhance our web browsing […]

Debjyoti Banerjee
May 24, 2024 ⋅ 8 min read
Bulma Css Adoption Guide: Overview, Examples, And Alternatives

Bulma CSS adoption guide: Overview, examples, and alternatives

Explore how Bulma CSS simplifies frontend development with its ease of use and customizable, responsive, pre-designed UI elements.

Timonwa Akintokun
May 23, 2024 ⋅ 10 min read
Using Mountaineer To Develop A React App With Python

Using Mountaineer to develop a React app with Python

Develop a React app with Python using the Mountaineer framework for building a simple app with integrated your frontend and backend database.

Rosario De Chiara
May 23, 2024 ⋅ 7 min read
Enhance CSS View Transitions With Velevette

Enhance CSS view transitions with Velvette

Velvette is a utility library developed to make working with view transitions easier.

David Omotayo
May 22, 2024 ⋅ 9 min read
View all posts

7 Replies to "Creating a Gatsby blog from scratch"

  1. Great blog post. In the GraphQL at the bottom, you forgot to include the “date” field in the frontmatter.

  2. great article, small edit though, on src/pages/blog.js the h2 tag needs curly brackets i.e. {post.frontmatter.title}

  3. Sorry it did not work.
    The error says “Multiple “root” queries found: “MyQuery” and “MyQuery”.”
    Seems the query name is conflicting between pages/blog.js and pages/index.js.
    Why does it happen?

  4. Hey, Heyo, sorry it didn’t work.

    The reason why build fails when there are two queries with the same name is because Gatsby extracts all queries and compiles them. So when there are two queries with the name – they will clash and an error will be thrown. There’s more information here https://www.gatsbyjs.com/docs/query-extraction/.

    If you take a look, we name the query inside pages/index.js as MetadataQuery and the one in pages/blog.js is MyQuery so they don’t clash.

Leave a Reply