Joseph Carl
June 3, 2017
<yourusername>.github.io
blog
(or whatever you want to call it)
README.md
if it exists# Install blogdown package
devtools::install_github('rstudio/blogdown')
# Load blogdown package and install Hugo
library(blogdown)
install_hugo()
# Change working directory to where you will build your site(s)
setwd("~/Documents/Github")
# Create new site in the cloned blog repository
new_site(dir = 'blog', # Local repo folder name
theme = 'kakawait/hugo-tranquilpeak-theme',
format = 'toml') # 'toml' or 'yaml'
# Change working directory to 'root' folder of site in order to serve site/write new posts
setwd("~/Documents/Github/blog")
# Rebuild and preview the website
serve_site()
After calling serve_site()
, go to localhost:4321
in browser
# Create a new post
new_post(title = 'your-post.Rmd')
Every time you save your page, RStudio calls serve_site()
This file is the backbone of your site, where most options are set
Some of the important options:
baseurl = "https://<yourusername>.github.io/"
theme = "hugo-tranquilpeak-theme"
publishDir = "../<yourusername>.github.io"
In RStudio: build_site()
In Terminal:
cd ~/Documents/Github/<yourusername>.github.io
git add .
git commit -m "building site with blogdown"
git push origin master
Open <yourusername>.github.io
in your browser