3 min read

How I moved my blog from Wordpress to a blogdown blog deployed by Netlify

RStudio-blogdown-GitHub-Hugo-Netlify

In a recent post, I detailed how I moved my main website from Wordpress to GitHub Pages with HTML in a Bootstrap 4 front-end. This post represents the next installment in this series and will focus on how I moved my blog from the Wordpress site to GitHub Pages, and specifically to a blogdown-style blog hosted on GitHub and deployed by Netlify. I don’t currently have time to produce a more detailed post now, but I give notes below on the 10 main steps that I took during this process.

10 Steps

  1. Backup Wordpress blog using backup plugin, and by downloading an archived version of my ‘public_html’ folder.

  2. Download/install and use exitwp to convert all HTML blog post pages into Markdown.

    • Time-consuming step: Editing image links, metadata, and other aspects of the converted Markdown files by hand (several hours, over 2 days).
  3. Create ‘blog’ GitHub repository without default README.md file.

    • Leave at ‘master’ branch (not really important for my purposes, since I will use a custom domain, but this means the blog would be at https://justinbagley.github.io/blog/ under the default scenario).
  4. Make GitHub Pages site from blog repository and make local README file that will eventually give details and license information.

    • Choose and indicate Creative Commons license for text/content, and prepare local MIT License file (‘LICENSE’) to cover all code on blog.
  5. Follow instructions on Alison Permanes Hill’s (APH) “Up and running with blogdown” blog post, starting with step 5:

    • APH step 5. Install blogdown and Hugo in R. (I also installed Hugo locally.)
    • APH step 6. Build site in RStudio with default Hugo Lithium theme; set configuration; make new blog post.
    • APH step 7. Deploy to Netlify–involved creating Netlify account.
    • APH step 8.3. ‘*rbind.io’ custom domain–requested custom domain ‘justinbagley.rbind.io’ from rbind support on GitHub, waited for custom domain to be fixed on rbind’s side, and added custom domain in Netlify and GitHub Pages.
  6. Edit css, HTML, and blog posts, and add all previous blog posts to the /content/post/ folder.

    • Inspiration for css was kbroman.org and my website jbagley.org.
  7. Set options to enforce “https://” URL, first at Netlify, then at GitHub pages.

  8. Add Google and Keybase authentications (files) for site.

  9. Add new posts and content by creating each new post (usually) in RStudio, then editing in RStudio or GitHub.

  10. Update sitemap and add to Google Search Console.

This was a little time consuming, because it involved editing the converted Markdown files by hand, familiarizing myself with blogdown (i.e. reading the book documentation), studying other blogdown blogs like Karl’s blog, and solving some other issues (e.g. with Netlify). I am still thinking of ways to improve what I have, but I really like my new blogdown blog. And the beauty of it is of course that it will allow me to embed math and generate plots from R code within a post–two awesome advantages of blogdown.

~J