Static site generators such as Jekyll are an increasingly popular set of tools targeted at creating simple websites such as brochure sites and blogs. The generators are typically lightweight command-line tools that take templates files that define the structure of the webpages and flat files of content in a format such as markdown as input. The output of this compilation process is a collection of static HTML pages that comprise the entire website.
For anyone familiar with working with a standard CMS such as Drupal or WordPress, the development and content publishing workflow associated with a static site may seem completely alien. By comparison a typical CMS-powered website will have content entered using a GUI such as a WYSIWYG text editor, and will generate pages on-demand server-side by retrieving this content from a database and rendering the output using a templating engine.
Using a static site generator may on the surface seem quite archaic compared to competing modern technologies and it’s undeniable that the scope of what can be achieved is drastically smaller than that of a CMS or framework. However, the 5 points listed below will hopefully convince you to give static site generators a second thought the next time you’re selecting a web platform.
Popular software will always be a prime target for hackers seeking to find exploits. Prominent content management systems (in 2015 WordPress alone powers 25% of the web) and web application frameworks are no exception to this. Whilst a savvy developer can mitigate this by adopting a responsible approach to security concerns and diligently applying updates and patches, there are inherently no security exploits associated with static site files. Additionally, if a static site is vandalized or taken offline through other attack vectors, the out of the box recovery strategy of regenerating and re-uploading the site (without requiring any additional back-ups) allows you to quickly get back online.
Arguably the biggest advantage of static sites is the fast speed at which pages can be delivered. The fact that requests to the server don’t require database queries or any other forms of processing gives them a significant performance advantage over a standard web application back-end. Whilst adding layers of caching can reduce this gap (with most content management systems shipping with some form of caching strategy), a correctly configured and optimized static site can deliver pages almost instantly and guard against any problems caused by surges in traffic.
The relaxed resource requirements associated with delivering static pages means that hosting options will generally be greater in number and cheaper than that of a CMS-powered site. As the generation of the site’s pages is typically performed in a separate environment (with only the outputted files deployed), there are no module or library dependencies to cause headaches. This portability means that sites can be migrated and resources upscaled easily.
4- Development speed
Jekyll allows you to very quickly spin-up a boilerplate project that includes a built-in development server and task automation for rebuilding the site upon any changes to files. The time saved by this speedy setup allows you to focus your efforts on important matters such as creating a beautiful, responsive front end. The ‘blog-aware’ nature of Jekyll means that commonly implemented functionality such as taxonomies and pagination can be easily included, offering further time-saving advantages.
5- Add it to your toolbelt
Getting comfortable working with static site generators and being aware of their strengths and, importantly, their limitations gives you more choices when deciding on the best tool for a job. Allowing yourself to be open to accepting new tools and methodologies is a key tenet of modern web development. Any time taken to familiarise yourself with tools such as Jekyll will have practical benefits, even if the end result is making you appreciate more the functionality provided by your favourite CMS or framework.
Hopefully keeping this list in mind proves useful when weighing up whether a static site generator is an appropriate option for your projects. At Nudge we are constantly re-evaluating the technologies we use in order to deliver the best possible digital experiences so feel free to give your feedback and suggestions in the comments below.