← Back to the notebook

· 3 min read

The rise of plain-text site generators

A look at Flat File CMSs and Markdown-based static site generators, with Hugo as the top pick.

#web#blog#markdown#hugo

Episode rescued from the SeViR Notes archive and translated from Spanish. Originally published on August 25, 2017.

Almost a decade ago, you’d build your website with Dreamweaver or FrontPage.

And since everything old comes back around, here we are in the 21st century, past Web 2.0 and 3.0, and it turns out the cool thing to do now is, once again, to edit your website locally or by touching the content files directly.

There are some differences, of course, and a lot of water has passed under the bridge, but we’re back to writing web content on our own computer with a desktop application.

The reasons are very different, though. And while WordPress and other online-editing blogs still hold the lion’s share, we now have complete website-building environments that don’t need a database: what are now called Flat-File CMS or Static Web Generators.

We need to distinguish between two kinds: systems built in PHP that work with text files, and website generators.

In both cases the content is mostly written in Markdown, but the workflow is different, even though, visually, a user couldn’t tell whether a site was built with one system or the other.

The advantage, besides being able to write faster and focus on the content rather than on how it’s displayed, is that, with no database, the site loads much faster.

On top of that, statically generated sites wouldn’t even need PHP or any other programming language support on the web server. Any web space, even GitHub, could host this kind of site.

From the first group, these would be the most interesting projects:

Flat File CMS

  • Pico CMS. A real classic: it runs on PHP with TWIG templates, supports Markdown content and has a good handful of templates.
  • HTMLy. More recent, it lets you edit content online and has an admin interface. This blog is running on it.
  • Grav. An interesting project, also built on Twig and Symfony, and very extensible thanks to a good number of plugins. It also offers online editing, configuration through YAML files and special content types. All in all, a very versatile system.
  • Dokuwiki. It’s been around for years: a wiki that’s quick to edit, ideal for documenting projects, with online editing and everything stored in files. Backups are trivial: just copy the whole folder somewhere else and it’s up and running.

Static Web Generators

  • Hexo. Generates a static site with NodeJS. It has a range of themes to change the look of the result.
  • WinterSmith. Also built on NodeJS, it was one of the pioneers, although it’s very basic compared with the others.
  • MkDocs. If you’ve written documentation in Markdown, it’ll surely ring a bell, or at least its default theme will: loads of projects use it to generate their documentation site. It runs on Python, which you’ll need to have installed.
  • Sculpin. Built on PHP and TWIG, it generates static sites, and you won’t need PHP afterwards to serve the result.
  • Hugo. The runaway winner is Hugo, a versatile system: since it’s written in Go, all you need is a single executable, available for Windows, Linux and Mac, to generate your site from Markdown. It has an impressive catalogue of themes for how young it is. Without a doubt, the one I’d recommend most.

Now all that’s left is to pick the one you like best.