Move blog to a new theme (blogdown)

Ji Huang 2021-05-30 2 min read

I was upset that I can’t set up Rmarkdown files correctly in my blog using even theme. Therefore, I changed it to a new minimalist theme: hugo-tanka today. There are some tricks, so I wrote down what I did.

  1. Start a new blogdown R project in RStudio with the theme I want:

img

  1. Move all my posts in the jhblog\content\post to the new destination jhblogv2\content\blog.

  2. Remove <!–more--> from the posts. This sentence has some wield behaviour on the new theme. So I deleted them from all the posts.

  3. Set up the Git and the Github repo.

  4. Delete the old blog site on Netlify, so I can keep the same URL.

  5. Set up new Github repo in Netlify.

  6. When setting up the Netlify, make sure to add HUGO version to the same as the local. You can do this by add a New Variable as HUGO_VERSION and set to 0.83.1

  7. Change site name in Netlify. The name will become the prefix for the website. For example, I set the site name to jhuang, then my blog website becomes jhuang.netlify.app.

  8. In config.yaml, change the baseurl: https://jhuang.netlify.app/. I don’t have to do this for the Even theme, but necessary for the hugo-tanka theme.

  9. Modify about.md for my personal introduction page.

  10. Choose a good flavicon from https://favicon.io/favicon-generator/ and replace the jhblogv2\static\images\favicon1.png.

  11. Now you should be good to go!