The Static site generators

Having a website these days is not just about looks. Performance is as important as the looks. That's why the trend of static site generator is on rise. It not just improves the performance by a factor of X but also improves the search engine optimizations. Static pages are easy for search engines to crawl and hence improve SEO ranking a lot.

There are many static site generator based on various front end framework and languages. I personally got chance to test some of them which are Jekyll, Hugo and Gatsby. Among of all of them I loved the experience with Gatsby the most. It is ReactJs based, makes website in form of SPA ( Single page application) and also has a lot of plugins and support community.

Related imageComparing different static site generators

The Content Management System

But you just want a static site but ability to manage the post and content easily.

You might get confused between static site generator and static sites, so let me clear this first. Static site generator can be related with a machine that takes the dynamic content and converts them into bunch of static pages which are fast. Here our content is dynamic which are regular post and media but stored in static format instead of wordpress mechanism of storing them in Databases

This also leaves you with the possibility of editing the backend things without going under the hood. For this you need to use a Content management System or CMS. Again there are many in the market. Gatsby support almost all of them because of its GraphQL integration. Popular one among them are WordPress, Forestry and Contentfull. For my project I chose Forestry because of 4 main reasons -

  1. Code is still available to edit and tweak outside the CMS .
  2. Backend is easy and fully customisable
  3. The file management is easy
  4. It does code commits for me which improves my GitHub profile and also helps the automatic deployment process.

The Version Control

So now we are using a CMS that does code commits we would need a version control to store our code. For this the choice was simple " GitHub". It's free and gives that adrenaline rush of committing the code that encourage to work more and more.

The Hosting

Its totally up-to you what hosting you want to go with. But for our stack the best is to go with Netlify hosting. Following are some clear reasons for that -

  1. Automated deploying of site to live as soon the code is pushed
  2. Deployment logs
  3. Developer Support
  4. Content Delivery network built in.

The Final Stack

So we have now a clear idea of what stack we need to use.

  • Github to store code and commits

  • Forestry to do commits for us and manage the content in a friendly manner.

  • Gatsby to generate static sites

  • Netlify to pull the code from master and deploy it on web

    Installation steps

    1. Visit https://www.stackbit.com/ and got to get Started
    2. Choose the theme you will like for your website
    3. Select Gatsby as static site generator
    4. Select Forestry as CMS
    5. Connect Forestry and GitHub Account ( Create them if you don't have already)

Vualla your website is ready !!

Your website will be automatically built and deployed on Netlify. To manage the code you can pull the code from the repo created in your GitHub Account. To edit the content and various element of the website you can got to forestry dashboard.

The steps are simple and so is the maintenance. The website delivers a performance of 90 on google lighthouse which is amazing.

You can also add analytics and other useful utilities from Gatsby plugin directory. This can be done by simply pulling the code from master to your IDE and doing the steps as directed in Gatsby documentations and then pushing the code to the master. Netlify deploy bot will automatically sense a new commit to master and deploy your website.

You can contact me if you faced any troubles as I Did a lot and can help you with your own deployment.