Building a website has never been so easy thanks to various software solutions, CMS (Content Management System) and blogging platforms. As we see more and more accessible online solutions to build a site, there are some classical elements that are still popular and will never fade away. I’m talking about plain HTML and CSS files that are used to build websites since the beginning of the web. This article is an introduction to static website and the static site generator Jekyll.
What is a static site?
A static site serve the content straight to the user as it is stored on the server side. To put it in another way, in opposition to WordPress which use a database to load dynamic content, a static site will display the same content to every user as it will directly load the HTML files on the server.
What is the difference between a static site and a dynamic website?
To make it simple, a dynamic website uses a database and PHP/MySQL to generate the content of a page when a user will request it. For example, building a website using WordPress CMS will result in having a dynamic website.
Why use a static site? Advantages of a static website over a dynamic site.
You may be wondering “Why should I build a static site when I could do a WordPress?”. Well, having a database implies a lot of downsides. Here comes the tree main advantages of using a static site over a dynamic one.
Static site: better performance and a crazy fast load time!
One the of the main advantages of using a static site is the fact that it is crazy fast to load. Indeed, when the user request a page, there is no need to request a database and various files in order to generate the page itself as all the content is already placed in a one and only file: an HTML one. That’s why, by using a static site you will get a boost in your loading time that will provide great user experience for the internauts. Moreover, we know that more and more people are surfing the web using their smartphones with, sometimes, poor internet connections, that’s why having fast loading times will participate in making your website mobile friendly.
Having a static website: say goodbye to hacking and security issues!
Tired of getting WordPress notifications about security issues and updates every week? No worries, as a static site has no database, there are close to no hack possible compared to a WordPress website. Indeed, your site will have way less footprints and security issues since it will only load plain HTML and CSS files. The security gain in having a static website is one the main reason why many famous brands switch to static site instead of having their website on Drupal or WordPress.
Building a static site and hosting: you will save you money!
Using a static site, you will only have most of the time only HTML and CSS files to host. This kind of files are super light which also means that you will not need a powerhouse hosting to have a static site up and running. Moreover, if your traffic suddenly increase, your site will not go down contrary to a dynamic site which should request the database each time for each user.
Why use a static site generator?
Working with HTML files can sometimes be quite annoying. Indeed, if you need to make a modification you must manually change every file. If you have a website with 10 pages, it can be ok but imagine if you have a corporate site with 100+ pages or a blog with thousands of pages?! Using a static site generator will solve this issue as it separates the content and the template. To say it another way, by using a static site generator you will only need to make the modification once and the generator will apply it to all your pages.
Which static site generator should I use?
As the popularity of static sites is growing, there are plenty of static site generators available on the market. The more famous are Jekyll, Middleman and Hugo. Each one has its own specificities and may suits you better depending on the programming languages you already are familiar with. When I wanted to switch from WordPress to Static I personally choose Jekyll as for me it is the best static site generator so far. This blog is powered under Jekyll.
Building a static site with Jekyll: the best static site generator so far!
Using Jekyll has been a pleasure so fa far! The generator is well made, simple to use yet powerful! Jekyll is also blog-aware which means that this static site generator supports blog creation and everything related (tags, archives,).
“Jekyll is a simple, blog-aware, static site generator. It takes a template directory containing raw text files in various formats, runs it through a converter (like Markdown) and our Liquid renderer, and spits out a complete, ready-to-publish static website suitable for serving with your favorite web server. Jekyll also happens to be the engine behind GitHub Pages, which means you can use Jekyll to host your project’s page, blog, or website from GitHub’s servers for free.” ― Jekyll Website
More details: on the official Jekyll Website