Converting WordPress Export File to Hugo

I have written on the Hugo static site generator here. Now I have written a migration program in the Go programming language to convert from WordPress export format to Hugo format. This program wp2hugo.go is in GitHub. It can be freely downloaded and does not need any further dependencies, except, of course, Go. The Go software is in Arch Linux or Ubuntu.

To convert a blog from WordPress you have to create an export file.

If the blog is not too voluminous one downloads a single XML-file which contains all posts and pages. If the blog in question is larger then you will receive an e-mail from WordPress.com that you can download a ZIP which contains two or more XML files in them. If you have such a ZIP-file, then unpack it, for example by using p7zip. Then run

go run wp2hugo.go XML1 XML2 ...

Continue reading

Considerations when converting from WordPress.com to Hugo

At times WordPress.com uses its user base to experiment with some half baked new features, see for example Classical editor in WordPress.com, or see this Hello Jekyll, bye WordPress.com! These are the times when I consider migrating from WordPress.com to another blogging platform. Usually after some grumbling I stick with WordPress.com, simply because it is very good. WordPress.com is working very reliably, offering a multitude of features not found elsewhere.

Hugo is probably the best choice regarding static website generators. Hugo’s strongest point is its speed, see 6 Static Blog Generators That Aren’t Jekyll. As this blog has more than 200 posts, and my other blog at Collected Links has almost 3.000 posts, speed is of concern. For a list of more static website generators see Top Open-Source Static Site Generators.

Below is a list of obstacles when considering migrating from WordPress.com to Hugo static website generator.

Below is a list of tasks and open issues when migrating from WordPress.com to Hugo:

  1. Migration itself: as of today there does not seem to be an out-of-the box WordPress.com migration toolkit. Ideally one takes the XML export file to start Hugo
  2. Automatic showing “Related to” blog posts
  3. Scheduled tasks: Using some crontab or at-job machinery will probably do the trick
  4. site stats: As the WordPress.com stats are no longer available one has to either use Google analytics, or analyze the weblog of the web-server. Right now I find the WordPress.com statistics page quite informative and I prefer it to the convoluted statistics page found on Google Analytics.
  5. top posts, blog stats directly on the blog
  6. Android app for publishing posts when you don’t want to turn on your laptop or desktop machine
  7. publicize, i.e., automatically sharing new posts on Google+, Twitter, Tumblr, etc.
  8. posting posts by e-mail
  9. password protected posts do not seem to work out of the box
  10. reblogged posts no longer work

Below list of features are already built-in in Hugo, and there is no need to work around it:

  1. math equations
  2. the “more”-tag seems to be there, it is called summaries

Added 11-Jun-2017: Julia Evans also uses Hugo. She migrated from Jekyll to Hugo. Her Hugo blog source is in GitHub.

2015 in review – report generated by WordPress

See the fireworks Elmar Klausmeier’s Weblog created by blogging on WordPress.com. Check out their 2015 annual report.

Here is an excerpt:

The concert hall at the Sydney Opera House holds 2,700 people. This blog was viewed about 14,000 times in 2015. If it were a concert at Sydney Opera House, it would take about 5 sold-out performances for that many people to see it.

There were 47 pictures uploaded, taking up a total of 425 MB. That’s about 4 pictures per month.

The busiest day of the year was January 2nd with 93 views. The most popular post that day was Three Free Invites For the OnePlus One.

Source: My 2015 annual report.