Org2Blog Migration to Quarto

Document my migration from using Org2Blog to Quarto for blogging.

Vinh Nguyen


January 19, 2023

This blog used to reside on a self-hosted Wordpress server, where I relied on Org2Blog and Emacs for publishing content using Org mode files to Wordpress. For a while now, I’ve been wanting to ditch Wordpress in favor of something simpler like Hugo (static-generated web content using markdown files, and hosted on an nginx server). I procrastinated for so long because I knew migrating my old content would be tricky if I wanted to maintain old links (e.g., to preserve search engine page ranks or break links referenced by other websites) and to substitute URL’s of blog posts in my posts with their new URL’s. Thankfully, each of my blog post is it’s own org file, so I don’t have to extract content from a MySQL database to obtain the blog content, and can rely on pandoc for converting org files to md files. The release of Quarto pushed me to finally migrate both my blog and my personal website.

This repo contains my bash and R scripts for the migration. The key steps are:

  1. Constructing a master lookup file that maps old links to new links (as the domain URL and structure of the each post’s URL is changing). This file is used to substitute old links with new links in the generated md files (converted from org files) in subsequent steps.
  2. Using the previous file, construct another mapping file that could be used by nginx to redirect URL’s from the old blog to URL’s in the new blog, using the 301 http status code. This setup is also documented in the repo.
  3. Converting org blog post files to md files using pandoc, and post-processing them in R as the resulting md files are not perfect.
  4. Converting the md files to html files using Quarto, and transferring them to an nginx server (I use the swag nginx image for nginx setup).