Wordpress to sw 2016-01-14
I've been wanting to get away from Wordpress for a while, with and eye to move to a statically-generated site. Today, I decided that I would use sw.
Steps:
- Export Wordpress into a nice little XML dump by using Tools > Export
-
Stick the resulting XML through exitwp
-
On my Void Linux system, I had to replace
from bs4 import BeautifulSoup
withfrom BeautifulSoup import BeautifulSoup
inexitwp.py
-
On my Void Linux system, I had to replace
-
Rename the resulting bunch of files from
*.markdown
to*.md
(sw only processes*.md
, and I already prefer that extension) -
Strip off metadata that I don't want from the results using
sed -i.bak '/^author/d ; /^slug:/d ; /^wordpress_id:/d ; /^layout:/d ;/^comments:/d ; /^---$/d' *.md
(put together from multiple sources because I don't know sed as well as I should) -
Semi-manually process the resulting files via
for i in *.md ; do vim $i ; done
- I used a macro to swap the first two lines because the title usually got stuck on the second line
- I corrected some questionable translation styles (not that auto-translating between different formats is easy)
- And I cleaned up some questionable formatting choices that I had inflicted on my posts
And that's about it:) Of course, now I'm going to go through them manually and individually sort them into proper categories while fixing file names and checking formatting more carefully.