For years my blog has been hosted on wordpress.com. As you have probably guessed from this blog entry's title I chose to host my blog on GitHub Pages going forward.
I had the following goals for my blog migration:
- Generating WordPress-compatible URLs
- Optionally, having a migration path to a new URL naming scheme
WordPress URLs look like this:
http://garbagecollected.org/2008/04/06/dollarmaps/Targeting GitHub Pages you then have two options:
- mkdir -p 2008/04/06; touch 2008/04/06/dollarmaps.html
- mkdir -p 2008/04/06/dollarmaps; touch 2008/04/06/dollarmaps/index.html
Now what about changing the URL naming scheme? Well, it turns out this is not really possible using GitHub pages. You would normally issue an HTTP redirect, but that's not supported. So then you can either generate placeholder pages that redirect using JavaScript or the <meta> tag, or create a custom 404 page that does the same. These are all more of a hack; you'll need to start telling Google that there is really only one page and things like that. For now I decided that new blog entries will follow the WordPress naming scheme until I find an easier hosting solution than GitHub's Pages.