A simple way to create a website with A simple way to create a - - PowerPoint PPT Presentation

a simple way to create a website with a simple way to
SMART_READER_LITE
LIVE PREVIEW

A simple way to create a website with A simple way to create a - - PowerPoint PPT Presentation

A simple way to create a website with A simple way to create a website with Blogdown Blogdown R Qubec Workshop R Qubec Workshop Mamadou Yauck & Sergio Ewane Ebouele Mamadou Yauck & Sergio Ewane Ebouele 2019-05-13


slide-1
SLIDE 1

A simple way to create a website with A simple way to create a website with Blogdown Blogdown

R à Québec Workshop R à Québec Workshop

Mamadou Yauck & Sergio Ewane Ebouele Mamadou Yauck & Sergio Ewane Ebouele 2019-05-13 2019-05-13

1 / 31 1 / 31

slide-2
SLIDE 2

É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. 2 / 31

slide-3
SLIDE 3

GitHub

3 / 31

slide-4
SLIDE 4

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).

  • 2. Go to the main page of the repository, and under the repository name, click the

Clone or download button.

  • 3. 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.) 4 / 31

slide-5
SLIDE 5

Command line/Terminal

5 / 31

slide-6
SLIDE 6

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
  • 2. Type: git clone [paste].
  • 3. Close the command line/terminal.

For more details, see clone your remote repository. 6 / 31

slide-7
SLIDE 7

RStudio

7 / 31

slide-8
SLIDE 8

What is Blogdown ?

8 / 31

slide-9
SLIDE 9

Blogdown and Hugo

Install the package blogdown from RStudio or use install.packages("devtools") devtools::install_github("rstudio/blogdown") Install Hugo:

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

Use the File button in RStudio to select File -> New Project -> Existing Directory, then browse to the directory on your computer where your GitHub repository is and click on Create Project. Edit the *gitignore le. If you want to use Netlify to deploy your website, you should add the public/ line (for more info.)

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

9 / 31

slide-10
SLIDE 10

Build your site

10 / 31

slide-11
SLIDE 11

Choose a theme !

To choose a theme, see Hugo themes. To save time, see Bookdown suggested themes. You can use the default lithium theme:

blogdown::new_site()

If you choose a theme, you can specify it while calling the new_site function. If you choose the academic theme:

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

If you want to add a theme later:

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

11 / 31

slide-12
SLIDE 12

Some basic edits

Update project options by doing Tools -> Project Options and following Bookdown instructions. Edit the baseurl in your config.toml le. The URL should always end with a /:

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

Feel free to edit other elements of the config.toml le ! For more details on conguration settings, read Bookdown chapter on conguration. To view your new site locally, use the Serve Site button, or run blogdown::serve_site 12 / 31

slide-13
SLIDE 13

Explore your new site Explore your new site

13 / 31 13 / 31

slide-14
SLIDE 14

Hugo directory structure

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

14 / 31

slide-15
SLIDE 15

Hugo directory structure

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

15 / 31

slide-16
SLIDE 16

Hugo directory structure

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

16 / 31

slide-17
SLIDE 17

Hugo directory structure

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

17 / 31

slide-18
SLIDE 18

Hugo directory structure

. ├── archetypes ├── config ├── config.toml ├── content ├── public ├── static └── img ├── themes

18 / 31

slide-19
SLIDE 19

Serve your site (locally)

Console

blogdown::serve_site()

The RStudio Addin Serve Site 19 / 31

slide-20
SLIDE 20

Edit your new site Edit your new site

For more details, see For more details, see Academic's page builder Academic's page builder 20 / 31 20 / 31

slide-21
SLIDE 21

Edit your new site Edit your new site

Edit your home page Edit your home page

21 / 31 21 / 31

slide-22
SLIDE 22

Change your bio

. ├── archetypes ├── config ├── config.toml ├── content └── author └── admin └── index.md ├── public ├── static ├── themes

22 / 31

slide-23
SLIDE 23

Update your CV

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

23 / 31

slide-24
SLIDE 24

Edit the navigation bar

. ├── archetypes ├── config └── .default └── menus.toml ├── config.toml ├── content ├── public ├── static ├── themes

24 / 31

slide-25
SLIDE 25

Create a new post Create a new post

25 / 31 25 / 31

slide-26
SLIDE 26

New post

Console

blogdown::new_post()

From the R menu: Addins -> New Post 26 / 31

slide-27
SLIDE 27

Deploy your new site Deploy your new site

27 / 31 27 / 31

slide-28
SLIDE 28

Deploy your site in Netlify

28 / 31

slide-29
SLIDE 29

Steps to deploy your site

Commit your changes and push to GitHub. Go to Netlify and Sign Up using your GitHub account. Log in and click on: New site from Git -> Continuous Deployment: GitHub. Select the GitHub repository already in use with blogdown, then specify the build command and the publish directory (to public). Your website is now deployed ! Netlify will assign you a subdomain name of the form somethingbizarre.netlify.com. You can change the subdomai name, for example to mamadouyauck.netlify.com. When you change your subdomain name, you must update the baseurl in your config.toml le,for example to baseurl = "https://mamadouyauck.netlify.com/". For more details, see Bookdown deployment instructions, or deploy with Netlify through GitHub. 29 / 31

slide-30
SLIDE 30

Reference

Alison Hill's Up and running with Blogdown 30 / 31

slide-31
SLIDE 31

Contact me Contact me

Personal website Personal website GitHub repository GitHub repository Twitter page Twitter page 31 / 31 31 / 31