This tutorial is roughly based on the blog post "Up and running with blogdown" by Alison Presmanes Hill.
To participate in the tutorial please have done the following:
- Install R
- Install RStudio
- Run
install.packages("blogdown")
in R - Run
blogdown::install_hugo()
in R (for a Mac user recommended to havehomebrew
installed first)
If you want to push up the website:
- Create a folder to hold the project
- Open RStudio, go to
Project
—>New Project
—>Existing Directory
—> [navigate to the folder you just created] —>Create Project
- Build the template of your site selecting a theme, we'll use the Academic theme create via
blogdown::new_site(theme = "gcushen/hugo-academic", theme_example = TRUE)
- Go to
Tools
—>Project Options
—>Build Tools
—> [uncheckPreview site after building
] —>OK
- To look at the current version of site run
blogdown::serve_site()
- Edit
config.toml
to display your name and any other changes you would like - Update
content/home/about.md
to your information - Write a new post, by running
blogdown::new_post([TITLE], ext = “.Rmd”)
and filling in the content as you would for writing a typicalRmd
document - Look at the
public
folder at various points to see the rendered version of your website
- Enable git in RStudio,
Project Options
—>Git/SVN
—>Version control system
—>Git
—> [clickyes
] - Go to
Git
—>Commit
and see the list of files - Add
public/
to.gitignore
- Commit the rest of the files
- Go to GitHub and create a new repository
- Scroll down to where it says
...or push an existing repository from the command line
, copy the commands - Open a terminal in RStudio by going to
Git
—> [the cog symbol] —>Shell...
; paste into the terminal the code you copied and run - Check that the repository on GitHub is updated with files
- Go to Netlify and click
New site from Git
and chooseGitHub
- Choose the repository you just created
- Check the configuration: 1) publish directory is
public
, 2) make sureHUGO_VERSION
is the same as when you typehugo version
in your terminal - Click
Deploy site
- To change the name (for free) go to
Site Settings
—>Site Details
—>Change site name