Codementor Events

What Is A Static Site Generator?

Published Apr 01, 2020
What Is A Static Site Generator?

Static Doesn't Mean It's A Bad Thing

I want to talk a bit about what a static site generator is. I feel that there are a lot developers out there that see the term static and feel that the site can't be dynamic when using something like Gatsby to build their site. I want to debunk that here. Static site generators such as Gatsby are able to create dynamic websites. The static portion of the phrase "Static Site Generator" just means that it uses static files such as images and the like in order to generate a website in lightning speed like fashion.

SPA's with React

Gatsby is the static site generator I choose to use because it's built on top of React. React is my go to choice for front end development so it makes sense for me to choose a static site generator geared towards using React.

Data Fetching with GraphQL

Gatsby also uses GraphQL under the hood to fetch your data from any type of datasource. It can be a JSON file within your application, an api built with any backend technology or even a database such as MySQL or MongoDB. Both React and GraphQL are built-in features of Gatsby so if you have experience with both then you will feel right at home.

A SPA from Markdown?

On the contrary, if you don't have experience with either technologies then you can write Markdown files and Gatsby will take the markdown and behind the scenes convert it to a React application upon serving it to the browser. I don't know about you but I think that is pretty awesome. You get to write, basically a README file and what gets served to the browser is a nice clean looking SPA built with React. It doesn't get too much easier than that. In a later post I will covering how to make a basic portfolio site with Gatsby. I will start with the basics including how to install Node.js, npm, yarn, as well as the Gatsby CLI.

Until next time keep calm and code on.

Discover and read more posts from Jonathan Reeves
get started
post commentsBe the first to share your opinion
Rodrigo Avila
4 years ago

Excellent post. I like it !

Show more replies