Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
July 20, 2020 05:49 pm GMT

Getting into Gatsby

Gatbsy is a very popular framework used to create static webpages. In this blog, we'll discuss what kind of tool Gatbsy is and why is it so helpful in building webpages that follow a JAMstack approach.

We will be going over:

  • What is Gatsby?
  • What is GraphQL?
  • How to get started using Gatsby?

What is Gatsby?

The common definition for Gatsby is, it is a static site generator. But lets discuss what this means.
This means Gatsby is a tool that will help us produce static sites using HTML, JS, CSS, images, and other static content, that we can then load onto a server. Which is a more JAMstack approach to building applications.
The traditional approach of server-side rendered applications is that that when you request a page on the application, generally it will then have to reach a database to retrieve the data and then build the page in real-time on the server to then send make to the client. With Gatsby, a JAMstack approach is taken to serving a website. Gatsby will create the pages ahead of time which is then served and the client is only requesting the static pages created. More specifically, Gatsby calls the endpoint with GraphQL, which fetches the data you need, and then a static page is created with that data. The data is only queried once and then served on to a server as a static HTML file.
Gatsby uses graphQL to query data from an external data source such as markdown files, JSON files, a database, or even an API. Gatsby includes plugin architecture, which allows us to load JavaScript, make API calls, add animations, build interactions onto the HTML files which allows us to still have very dynamic websites. Gatbsy also uses React for templating and CSS for styling.

What is GraphQL?

GraphQL is a querying language that allows you to query for data by describing the data you want to receive from a data source such as a markdown file. You are then given the data in the way that you asked for it

How to get started using Gatsby?

Gatbsy uses Node, so Node will need to be running on a development environment on your computer. You will need to have installed Node and Git before installing Gatsby. You start off by installing Gatsby on your local machine globally. You then run Gatsby on your computer, by creating a new Gatsby template and it will help you set up your application to generate static pages for you. The Gatsby documentation explains thoroughly how to get started with building sites on Gatsby from quickstarts for experienced developers who are ready to jump in, to step-by-step tutorials for beginners starting from anywhere.


Original Link: https://dev.to/cs_carms/what-is-gatsby-4lgj

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To