Yesterday I decided to try blogging again. I started writing a post at blogger.com, but that was like wading through a rotting whale corpse. Instead I decided to use GitHub Pages and use the static blog/site generator Nikola to generate the content, editing reStructuredText (ReST) files.
I wrote my first post and it was good! Using ReST again was much better than editing in a GUI like blogger.com, and having it hosted by GitHub Pages was more restful than running a machine hosting a website.
But then I thought of all the posts I had in my old blog, before I stopped running machine hosting a website. They were all written in ReST — maybe I could put them up on my new blog?
I took a couple three hours and wrote a shell script to find the old
pyBloxsom files and feed them into a python script that I also wrote.
Along the way I made sure the files all had
#tags lines, in that order, immediately following the title line.
Here's the shell script:
#! /usr/bin/env bash (cd ~/myblog && find notentries/ entries/ -type f -name \*.rst | ~/comp/tkbtools/Scripts/pyblox-to-nikola)
Here's the python script:
There were 810 reStructuredText files to process. Once that was
done, I had to work through those files multiple times finding all the
broken internal links, since many of them were absolute links to my
old blog or other pages on my old website. I did grep-find in Emacs
multiple times to find all the occurances of my old website's hostname
(which went through a couple of variations over time), then looked for
site relative links that started with
/~tkb, a tedious but not too