MKDOCS
Build a static project website on GitHub
Matt Holder investigates static site generators, what they are useful for and why they are better than CMS in some situations.
Credit: www.mkdocs.org
OUR EXPERT
Matt Holder has worked in IT support for over a decade, so he has always tried to utilise Linux alongside the other installed systems.
QUICK TIP
Further information about MkDocs is available here: www. mkdocs.org
We are going to investigate some static site generators in this tutorial, plus discover what W they are useful for and, in some situations, why they are better than a CMS, such as WordPress, which has reached the grand old age of 20 now.
Static site generators are, as the name suggests, pieces of software that can be used to take content and build a static site from that content. The word static probably suggests something pretty basic, but this does not need to be the case at all. Static site generators can include all manor of functionality, such as blogging support, CSS that changes the rendering on different screen sizes, and beautiful theming.
There are many advantages of using a static site generator, one of which is that of the overhead of the hosting environment. When using a system such as WordPress, the web server needs to execute PHP code via a plugin, and this PHP then queries a database and extracts information, which is manipulated and output as HTML. All of this takes more resources than simply hosting HTML, JavaScript and CSS. You might think this doesn’t sound like a particular hardship, given that we all have multicore processors and many gigabytes of RAM, but for busy websites, with lots of visitors, this overhead soon adds up. Also, when the content isn’t constantly in flux, there is nothing wrong with using a system such as the ones we discuss here.
A second positive of using one of these generators is that the content can be written in a known format, such as Markdown. This is incredibly powerful, in that your content can be changed between multiple generators and can also be used with something like Pandoc, which allows for Markdown to be converted into any number of different formats.
While addressing the positives, let’s also look at the negatives. What would a static site generator be less suitable for? Well, if the content needs to be manipulated on page load – let’s assume for a moment that the tense of a piece of prose needs to be changed given the date the content is being read, or changed for a different time of day – then a CMS is probably better suited for the task.