Étapes de la présentation

  • Créer un répertoire GitHub;

  • Établir la communication entre une session Rstudio et un répertoire GitHub;

  • Transférer les documents d’un projet RStudio dans un répertoire GitHub;

  • Créer un projet BlogDown avec RStudio et le connecter à un répertoire GitHub;

  • Charger un thème de la plateforme HUGO avec Blogdown;

  • Créer un compte sur Netlify;

  • Établir le lien entre un compte GitHub et un compte Netlify;

  • Déployer un site web développé sous RStudio, avec Netlify, à partir d’un répertoire GitHub.

GitHub

Create a GitHub repository

  1. Open your GitHub account and create a new repository (initialize with a README but don’t add .gitignore for now).

  1. Go to the main page of the repository, and under the repository name, click the Clone or download button.

  1. In the Clone with HTTPs section, click on the clipboard icon to copy the clone URL for the new repository (we will paste this text into the terminal in the next section.)

Command line/Terminal

Clone the GitHub repository

We are going to create a local copy of the repository on your computer so you can make the two locations communicate (using the command line tool for Windows or the Terminal for Mac OS X).

  1. Use cd to indicate the directory where you want your repository to be located

  1. Type: git clone [paste].

  1. Close the command line/terminal.

For more details, see clone your remote repository.

RStudio

Blogdown and Hugo

blogdown::install_hugo()
library(blogdown)
install_hugo()

.Rproj.user
.Rhistory
.RData
.Ruserdata
blogdown
.DS_Store # Thumbs.db for Windows users
public/ # for Netlify

Build your site

Choose a theme !

To choose a theme, see Hugo themes. To save time, see Bookdown suggested themes.

blogdown::new_site() 

blogdown::new_site(theme = "gcushen/hugo-academic", theme_example = TRUE)

library(blogdown)
new_site() # default theme 
install_theme("gcushen/hugo-academic", theme_example = TRUE, update_config = TRUE)

Some basic edits

baseurl = "https://website.com/"
baseurl = "/"

Feel free to edit other elements of the config.toml file ! For more details on configuration settings, read Bookdown chapter on configuration.

class: inverse, center, middle

Explore your new site

Hugo directory structure

.
├── archetypes
{{├── config}}
├── config.toml
├── content
├── public
├── static
├── themes

Hugo directory structure

.
├── archetypes
├── config
├── config.toml
{{├── content}}
    └── author
    └── home
    └── post
├── public
├── static
├── themes

Serve your site (locally)

blogdown::serve_site()

class: inverse, center, middle

Edit your new site

Edit your home page

Update your CV

.
├── archetypes
├── config
├── config.toml
{{├── content}}
    └── home
      └── accomplishments.md
      └── experience.md
      └── skills.md
      └── ...
├── public
├── static
├── themes

class: inverse, center, middle

Create a new post

class: inverse, center, middle

Deploy your new site

Steps to deploy your site

When you change your subdomain name, you must update the baseurl in your config.toml file,for example to baseurl = "https://mamadouyauck.netlify.com/".

For more details, see Bookdown deployment instructions, or deploy with Netlify through GitHub.

Reference

Alison Hill’s Up and running with Blogdown

class: inverse, center, middle