Main Page

From uCtrl

The platform hopping continues

As you may have noticed — I have switched from Hugo to MediaWiki. One being a static site generator, the other is the software that poweres Wikipedia.

Why change?

  • Editing is easy with Mediawiki, very easy. Simply go to a page and click edit, it can be done anywhere. With Hugo there are more steps involved; edit markdown file, commit and deploy.
  • A wiki has full revision history, which I find quite useful. Committing your Hugo content files to git also gives you that; but what to do with a couple of gigabytes of images? Do you commit those?
  • MediaWiki is massive, popular and well maintained. It's easy to find resources online. This is also true for Hugo, so I guess it's a draw here.
  • Content management in MediaWiki is awesome! It keeps track of how pages are linked, and here images and media files are used. Wanted pages/categories/files is really useful.
  • Internal linking with MediaWiki is very easy, and easy to maintain.
  • MediaWiki handles redirects well, and it's easy. Moving pages leaves a redirect, and double redirects are automatically handled.
  • Thumbnail creation, photo galleries, lightboxes — it all works very well in MediaWiki.
  • Using a bot for content management in MediaWiki is pretty sweet!

How did you migrate?

That was actually easier than I had anticipated... I converted markdown to MediaWiki syntax using PanDoc.

find content -name "*.md" -exec pandoc -w mediawiki {} -o {}.wiki \;

I manually copy and pasted the content of the files into the web form, and validated the syntax. After all pages were created, I was left with a wanted files list of about 300 items. I put this into a text file and used a combination of find and Pywikibot to automatically locate and upload them.

while read p; do
    find -L ~/Photos/ -iname "$p" -print -quit >> found_files
done <wanted_files
while read p; do
    cd ~/dev/pywikibot/core_stable/
    pipenv run python3 upload -keep -noverify $p "Migration from" < /dev/tty
done <found_files

That was mostly it, I did have to tweak the pages a bit. But that was minor stuff really.

Ongoing projects

  • Move Alpha server into a new rack chassis.
  • Move Zeta storage server into a storage rack chassis.
  • Finish the electronics for my Prometheus Alertmanager stacklight module (more info to come!)
  • Find my old wiki installation and port all pages into this one :)