on
Set up a website with R using blogdown, GitHub, and DigitalOcean
I am writting this because it took me some long nights and days to try to figure out how to get started with blogdown. Hopefuly this post helps someone just like these sources have helped me:
Yihui Xie’s fantastic blogdown book, Alison Hill’s amazing step by step, and, Collin Quirk’s super ueful guide to upload blogdown into DigitalOcean
In GitHUB
- Create a repositary, name it as you want and enable a README
- Click on the green buton “Clone or download”
In your terminal
- Open git bash, select the local directory where you want to clone the GitHub repo
git clone https://github.com/araupontones/blog.git
In R studio
- Create a project in the local folder where the repo was cloned
Install.packages("blogdown")
- Create new site and choose a theme
blogdown::new_site(theme = "nanxstats/hugo-tanka", theme_example = TRUE)
In your cloned folder
Check all the directories that were created when you created the site and configure the congig.toml
In DigitalOcean
I followed Collin Quirk’s approach which is very simple:
“Install nstall nginx apt-get install nginx
and pandoc apt-get install pandoc
. Start an interactive R session (by typing R
) and install blogdown install.packages("blogdown")
followed by hugo blogdown::install_hugo()
. That is all you need to do in terms of setting up blogdow.”
- Open your terminal and navigate to the directory where you will clone your GitHub repo.
git clone https://github.com/araupontones/blog.git
- Copy the files like this
sudo cp -r public/. /var/www/html/.
- In case you want to interact with files within the server:
chmod -R 777 www/.
Understanding Linux File Permissions
et voila! your website is up and running!!!