From WordPress to Pelican and Back to WordPress

This blog started out built on WordPress. For some reasons that made sense to me at the time, last year I moved everything over to a platform called Pelican.

Pelican is a static site generator that takes plain text input and converts it to web pages.  This is great for a variety of reasons, especially if you like writing in Markdown or want to keep your blog in some kind of source control.

Both of those sounded pretty neat to me and I got tired of WordPress, so I made the jump. I downloaded my WordPress installation, ran a script to convert its posts to Markdown, then tinkered with a few themes and plugins until I had something that looked fairly close to the original.

For a time, things were good. I enjoyed writing in Markdown. It took me back to the “old days” of plain text, scratching out the words without care for how they might appear. There was a kind of magic to the process. Writing, then waiting, then finally seeing the article published. All it took was Notepad++ and a command line and baby, I had a blog going.

Then I took a break. Life got in the way. I finally returned to add new posts, but when it came time to publish I actually forgot for a moment what the damn tool was even called. Then I forgot the command line options. Then I forgot where the output went. Most recently, I tried linking one article to another and this caused the generator to throw new errors. I googled around for about ten minutes before thinking, “I don’t have time for this.”

So instead of fixing that problem I spent an evening restoring WordPress. If you’re curious, here’s how to do it like I did:

  • Create a brand new WordPress installation
  • Google “export pelican to wordpress”, then wonder if you have your old backup still
  • Find the backup *.tar.gz file and poke around its contents
  • Upload everything over FTP
  • Play Master of Orion while you wait for 3,500+ files to upload
  • Update wp-config to point to the new database
  • Drop all the tables and recreate them with the old WordPress DB table contents
  • Find the functions.php file for your theme and add a few lines of code to programmatically update all mentions of the old URL to the new URL
  • Refresh the login page about 5 times
  • Log in and update WordPress
  • Update hyperlinks in posts
  • Copy-paste the Pelican posts into WordPress posts

And voila! It’s like I never left WordPress! Except for all the times I linked to the old old blog, then destroyed them by moving to Pelican, and then destroyed those links by moving again over here. One day I’ll write a redirect so folks following those old links will come here, instead. Another day.

Mang 1.0 is Released

As part of my ongoing work with SCOREDIT, I’ve been working on porting some old code to a new utility for use in my newer project as well as a few other things I’ve got going on. To that end, I released Mang (Markov Name Generator), a tool for generating names and words.

Sigh… A procrastinator’s work is never done…

Mang uses Markov chains to generate output that is similar to, but not the same as, a given set of inputs. This means if you feed it a dictionary of English words, it will output words that look like English but are just a little bit off. This is great for building up conlangs, creating NPC names for your tabletop games, etc.

The library comes “batteries included,” meaning it already has a small collection of names you can use for name generation. The readme has more details on this. You can also browse the source to see what all is available.

I’ve had the old Mang lying around for a long time gathering dust. Built with WPF, it was serviceable and the output was okay. But I wanted to extract the Markov and name generation code and make it into something more portable. I was also frequently unhappy with the output, hitting the refresh button forever until I found something inspiring.

The new Mang has a few improvements to word generation to ensure no gibberish is put out. The library itself is tiny – just a few files. And its interface is small and foolproof.

To prove all these things to myself I plugged it into SCOREDIT today and got to generating:

Mang used with SCOREDIT to generate words

As you can see, it’s not all perfect, but there’s a few good ones in there to serve as starting points. In the future I plan to extend the generation capabilities to come up with more “realistic” output, but that’s another blog post.

Head on over to the repo to check it out!