What Are Static Site Generators?

The simple technology behind some of your favorite websites

In the early days of the Web, pages consisted of simple HTML and CSS. They weren’t dynamic programs and there weren’t extensive databases behind them. As a result, it was cumbersome and time consuming to update an entire site or apply new styles. To solve the problem, developers started using programming languages like PHP to make websites. Websites transformed from simple HTML affairs to full-blown applications in their own right.

Static HTML

Dynamic Websites

With a dynamic, program-based website, content generates using the code and there’s no need to code every single page individually. All the important information is stored in a database and the program plugs it in to each page where appropriate. In most situations, it’s more efficient and easier to manage.

For simple sites, though, a dynamic website is unnecessarily complicated. If you only need a simple page or two that displays some information about your business, a complex web platform is overkill. Then there’s the speed factor. Simple static sites are much quicker. There’s nothing going on in the background, it’s just simple HTML. So, static sites are insanely fast in comparison.

Why A Static Site Generator?

What happens when you want the benefits of both a static site and a web application? That’s where a static site generator comes in. Instead of having a web application constantly running on your web server, use a static site generator to dynamically create your site and all the static pages in it. Then upload the files to your server and everything’s set. Your site is still dynamically generated, but it’s dynamically generated once before you put it online, instead of each time someone makes a request for a page.

Jekyll static site generator creating a simple site

Static sites generated with a static site generator are much faster than dynamic sites. They require fewer server resources to run and they can handle more traffic.

Static sites are also more secure than dynamic sites and they require less maintenance. As with any other computer program, a web application like a dynamic website suffers bugs or security flaws. These flaws are behind a decent amount of the famous data breaches in the news. WordPress is the most popular dynamic website platform, and it’s also a favorite among hackers. Static websites don’t have a program to exploit or a database to break into.

Popular Options

Static site generators have grown in popularity. There are dozens of common options, but a few stand out as favorites.

Jekyll is popular and it’s been around longer than most. It’s written in the Ruby programming language—the same one that gave rise to the popular Rails framework—and it features its own convenient templating language to simplify the creation of your pages. If you’re looking for somewhere to start with static site generators, Jekyll is a great place.

Take a look at Hugo, Nuxt, Gatsby, or Wintersmith, too. They’re all popular options and offer features similar to Jekyll with their own spin. They’re all free and open source.