Static site generators are great for a lot of things but I’m especially excited about their potential in the world of book publishing. Most small publishers don’t have the resources to maintain a new server-side application every time they want to publish a new book. And for us as a museum, the long-term availability of the content is an important concern. But the bar is set very high by the beautiful print books people are accustomed to, so delivering a poor experience in the name of long-term sustainability is not an option either.
I think that’s where tools like Middleman really shine. There is a master set of content files (Markdown and YAML docs) and then a series of different output formats are auto-generated as necessary. Write once, put it in version control, and publish anywhere – that’s the dream, and I think it’s becoming doable.
Anyway, that’s the underlying philosophy behind the project. It is 100% static – the “database” for catalogue entries is just a bunch of YAML files. Other static features include:
- Client-side search (full-text) via Lunr.js.
- SmoothState: These two actually work together; the full-text search index is too heavy to load each time the user navigates to a new page, so with SmoothState it is initialized once and then always ready. In some ways these performance gains were much more important than the transition effects, though the latter is why I first wanted to use it.
- The catalogue page is actually a self-contained Vue.js component; Vue is a really promising framework for these kind of static projects. Client-side JS apps plus static back-ends are a powerful combination.
- Leaflet.js powers both the maps as well as the zoomable images; it’s a really versatile library
- PrinceXML for automatic generation of a printable PDF. This is the only non-open-source tool in the stack, but nothing else comes close to its output quality in my experience.