Using blogdown with an existing Hugo site
If you decide you want to use R in your existing Hugo blog, it’s really easy to convert over. There’s a single command you need to know from blogdown and the rest is working out your deployment process.
To create content, use the blogdown Rstudio add-in to quickly get started. This niftily reads all tags and categories from past posts to help you get going.
You can then write Rmarkdown as usual. The workflow differs in that,
instead of hitting the Knit button or using
This will process all your
.md files and run the
command. This works in place of
hugo so you will need to alter your
deployment process to just pick up from the
public/ directory instead
of running Hugo.
You can then publish the content from the
Converting your existing Hugo site to
blogdown is actually super
simple - it’s literally one command,
blogdown::build_site(). The bit
that will take some work is changing your deployment workflow.
blogdown in a CI/CD environment
If you want to use some sort of automated build, you can use
travis to run the
build_site() and commit
public/ dir changes. If you do this, don’t forget to
[ci skip] at the beginning of your commit message to avoid an
infinite loop of builds.
Once you have the files automatically building, you can then deploy
using something like netlify and simply remove
the build command as it’ll only need to retrieve the content from the