WordPress => Hugo

Sun, 19. May 2019

Categories: en Tags: Hugo WordPress Atom ShaarliGo

Wordpress got me started without having to deal with html and css or php. Thank you!

Later, when blogging intensity dropped to almost zero, the quarterly or so php and mysql updates became my only activities for the blog. And the more popular wordpress became, the less comfortable I felt with it.

Then, 5 years ago, I learned about the static site generators jekyll and nanoc. But what about comments? Having the old comments around was dear to me and handing them to a 3rd party was not an option, nor was adding external dependencies. I thought about isso, but was reluctant to add another runtime (python), now that I just would get rid of php.

Meanwhile, I built a microblogging engine, ShaarliGo, that actually is a static site generator as well and uses atom feeds as the sole publication format and leaves the template rendering to the browser. No javascript. No php. No database. Nice.

Finally, I learned about hugo, which also got me rid of all runtime and gem dependencies. More and more, I got fascinated by minimal solutions. (A plea for lean software)

The wish to migrate to a no-bullshit static blog grew, until I finally accepted to sacrifice the comments as well as the search — just to get rid of php and mysql.

But not before moving, I recognised that comments can remain the atom feeds they already were and be rendered in the browser! Like ShaarliGo does all the time. Just inside an iframe!

The actual move then was

  1. export with SchumacherFM/wordpress-to-hugo-exporter,
  2. customise the wonderful hugo theme xmin a bit,
  3. brush through all posts for markdown conversion hickups and inline html,
  4. dump all existing comment atom feeds (iterate all urls and curl),
  5. gently clean them (sed and a bit of perl) and add a xslt processing instruction,
  6. add duckduckgo site search. Scoped by redirect. What’s good enough for w3c, is surely good enough for me.

Commenting via email. New comments now require manually copy+paste into a new atom feed entry.

Not perfect, but sounds feasible for the time being — until the 100th comment :-)