Hello Hugo! Hello Blogdown!


I took the opportunity to try out the newly released blogdown R package and migrate my blog over from Jekyll to Hugo.

This blog has been up for just over two years and Jekyll was working fine, but I never felt really comfortable. I’m guessing that the Blogdown package will become enormously popular and it seems that Hugo has more flexibility for me. Also, Blogdown and Rstudio integrate better with Hugo than Jekyll.

And we got a fancy new theme

By far the best part of migrating was picking out a fancy new theme for this space. There’s quite a lot of different themes available for Hugo, though not all of them play nice with Blogdown.

After trying several out, I decided that Ghostwriter would be a nice simple theme for this space. It’s pretty close to my old theme, especially after I tweaked it.

In addition to shifting the main color from red to royal blue, I also took the opportunity to make the page more readable by changing the font from gray to black. I just had to dig into the Ghostwriter .css file and switch out the colors (in several places).


Migration wasn’t too hard. My original site wasn’t too complicated, though I did have a lot of images. The biggest challenge was broken links and redirecting image sources. Fortunately, I picked up some regular expressions and code snippets from the Blogdown book that made it easy. I also decided to add tags and categories to my posts which is hard to do ex post and consumed a fair amount of time.

Also, getting the links and images to work took some time. Gave me the motivation to learn some regular expressions. Here’s a flavor of what I had to do.

Recompile and go

The last thing was to re-run my Rmarkdown code and rebuild the site. The Rmarkdown code mostly ran well, but I had to go back and reload some libraries I hadn’t reinstalled when updated R.

The final step was to all the stuff in my new blog and save it under my old blog directory (after I archived the old blog). Then I was good to go and here we are.

Be sure to check out my new post tags which should help you find posts based on topic. I’ve also added a projects page that I’ll be adding longer pieces to from time to time.