Why did I rewrite my blog using Eleventy ?
Reasons to change
This personal home page and blog was previously self-hosted using a great Open Source Wiki engine: Dokuwiki. It worked great for long years but few months ago, I felt than it was time to change lanes and embrace the JAM Stack (JavaScript / API & Markdown).
Issues with traditional wikis
- Security: many spam in comments, possible PHP vulnerabilities
- Regular upgrades to be performed against the engine
- Many plugins required to make something useful. Old ones, conflicting ones...
- Not so easy to customize the rendered pages
- Slower than a static website
- Much larger electricity consumption to serve pages
- Requires PHP modules to be installed and tunned along with the HTTP server
- Most wiki engines require a database (even if it is not the case of Dokuwiki)
- Not so easy reversibility. One way way is to use Pandoc to translate wiki syntax to markdown.
Opportunities with the JAM Stack
- Ability to write articles using a more widespread markdown languages than one of the numerous Wiki syntaxes around
- None vulnerability possible (except from the Web server itself) as the produced website is only static HTML
- Using Git (advanced version control) and associated ecosystem (Merge Requests...)
- Possibility to use CI/CD tools to deploy new pages
- Can be deployed on CDN (even if I continue to self-host it)
- Possibility to use great IDE to write articles (like VSCode and all its extensions)
- Faster preview of rendered page : I can now see in my browser the result in less than a single second
- Containers-friendly (using a nginx docker image typically)
- It's the new trend ! (OK, it's a kind of RDD but it may be useful in current professional context)
The not-so-good using the JAM Stack
- You have to rely on external services to perform some basic features like adding comments (already disabled in my case, too many spam messages) or full-text searches
Eleventy
Well, I finally decided to switch to the JAM Stack. But it is very crowded. I already use Antora at work to generate great technical documentation using Asciidoc but it was not suitable for a blog. I also used Jekill for a long time with Github pages (see Jajuk website) but I find it complicated, aging and too restrictive.
After a quick look at the most popular platform (Hugo), I gave up. Basically, I felt than I had to learn a full world before being able to make a website and I haven't this time.
Then, I heart about a new simple platform: Eleventy. I loved the Unix-like idea behind it: a very low level tool leveraging on existing templating engines like Liquid or Nunjucks and allowing to mix HTML and markdown contents. It also leverages a convention over configuration principle enabling results in no time.
Last but not least: it is very fast (near as fast as Hugo). It is a JavaScript tool great for most frontend developers who can use npm, sass... Look at this page if you want to see sample code using Eleventy.
I finally rewrote my website in raw CSS, HTML, Markdown and Liquid templates thanks to Eleventy. It only toke me a single day to grasp basic Eleventy concepts and port the existing website. I finally got a full control over my pages.
Note that another common strategy is to use an existing theme (like a Bootstrap-based theme) and to make the HTML generic using templating templates. I gave up this method because I wanted something simple, very light and something I fully control and understand...