Converting Lewicowo from WordPress to Eleventy
About 8 years ago I was asked to build Lewicowo.pl – "a portal devoted to the traditions of the Polish democratic, patriotic and non-communist left". Like almost every site I did around that time, I've built it on WordPress. During these past 8 years ~1300 posts have been published – mostly digitized articles from 19th and the first half of 20th century. It was a non-for-profit, hobbyist effort of its editor in chief with some help of a couple volunteers. Recently he decided he would no longer add anything to the site, but will keep it online for the time being.
It would have been a great loss and waste of the tremendous work that had been put into digitizing and editing all those documents if someday the site just disappeared. Lots of the articles published are century or more old rarities, almost impossible to get elsewhere, even on paper. So I decided I needed to do something to ensure its longevity (meaning: it cannot stay on unmaintained WordPress – it already had been compromised and restored from the backup once during its lifetime). Of course there is Wayback Machine, but the discoverability and experience would not be the same as with the original site.
Interestingly, to convert this website from WordPress, I used 11ty in two cycles: first to produce the source .md files (including content and yaml frontmatter) from one huge (33mb) exported .xml and only then generating the final .htmls in the second run. There was also a lot of bulk regex find and replace in between to clean up some WP/WYSIWYG mess, probably not perfect, but acceptable.
All in all both me and the website's editor are satisfied with the end result. There were some compromises – there's no longer internal search nor comments, but balancing those drawbacks, on the occasion, I managed to make the new site responsive (the old one wasn't), and most importantly: safe from being hacked, backed up and trivial to restore or move to a different server, fast and (besides domain renewal costs) cheap/free to host.
The design part was kept to the minimum, just to ensure decent reading experience. Being a huge Tailwind fan, given this project's simplicity, this time around I limited myself to some handpicked Tachyons classes, skipping the whole PostCSS/PurgeCSS pipeline.
On my desktop the site (overall, with all the paginated tag archives, its 1673 files, so quite a lot) takes ~33 seconds to build. ⅓ of that could be shaved if html-minifier was skipped. Build time doesn't really matter in this case, as it won't be regenerated on a regular basis, maybe even never (unless to correct some mistakes), but it's still worth noting – pretty impressive for that many files processed.
This was my first encounter with 11ty (formerly used Middleman, Jekyll, Spike and recently Hugo) but definitely not last. In fact, I've already got another one in the making – about the history and traditions of weaving in central Poland :)