+ - 0:00:00
Notes for current slide
Notes for next slide

Build a website with R

in 13 steps

Jonas Großekathöfer

04. November 2019

1 / 40

my web dev background

2 / 40

my web dev background

  • I know nothing about CSS
  • I know nothing about HTML
2 / 40

my web dev background

  • I know nothing about CSS
  • I know nothing about HTML

  • I know nothing about CSS
  • I know nothing about HTML
2 / 40

my web dev background

  • I know nothing about CSS
  • I know nothing about HTML

  • I know nothing about CSS
  • I know nothing about HTML
2 / 40

Today

3 / 40

Today

  • teach nothing about CSS, HTML
3 / 40

Today

  • teach nothing about CSS, HTML

  • talk as little as possible about R

3 / 40

Today

  • teach nothing about CSS, HTML

  • talk as little as possible about R

  • prepare the basic setup

3 / 40

Today

  • teach nothing about CSS, HTML

  • talk as little as possible about R

  • prepare the basic setup

  • offer an overview

3 / 40

Requirements

4 / 40
5 / 40

open R(Studio)

6 / 40

open R(Studio)

6 / 40
7 / 40

install blogdown

install.packages("blogdown")
8 / 40

install blogdown

install.packages("blogdown")

errors?

8 / 40

install blogdown

install.packages("blogdown")

errors?

install.packages("missing-package")
8 / 40

install blogdown

install.packages("blogdown")

errors?

install.packages("missing-package")

and try again:

install.packages("blogdown")
8 / 40

install blogdown

install.packages("blogdown")

errors?

install.packages("missing-package")

and try again:

install.packages("blogdown")

blogdown installed!

8 / 40
9 / 40

install HUGO

blogdown::install_hugo()
10 / 40

install HUGO

blogdown::install_hugo()

HUGO installed

10 / 40

Requirements

11 / 40

website

12 / 40

website

1) build

12 / 40

website

1) build

2) modify

12 / 40

website

1) build

2) modify

3) publish

12 / 40

1) build website

RStudio

13 / 40

1) build website

RStudio

14 / 40

1) build website

RStudio

15 / 40

1) build website

RStudio

Console

setwd('~/Desktop/jc')
blogdown::new_site(
dir = 'site1',
theme = 'gcushen/hugo-academic',
install_hugo = TRUE,
sample = TRUE,
theme_example = TRUE,
to_yaml = TRUE)

Does not create a project

16 / 40

1) build website

RStudio

Console

setwd('~/Desktop/jc')
blogdown::new_site(
dir = 'site1',
theme = 'gcushen/hugo-academic',
install_hugo = TRUE,
sample = TRUE,
theme_example = TRUE,
to_yaml = TRUE)

Does not create a project

more Hugo themes can be found at https://themes.gohugo.io/

16 / 40

1) build website

RStudio

File explorer

DIY

17 / 40

1) build website

RStudio

File explorer

DIY

18 / 40

1) build website

RStudio

Console

blogdown::serve_site()
19 / 40

1) build website

Serving the directory C:\Users\jog54yy\Desktop\jc\site1 at http://127.0.0.1:6868

20 / 40

1) build website

Serving the directory C:\Users\jog54yy\Desktop\jc\site1 at http://127.0.0.1:6868

RStudio

Browser

20 / 40

1) build website

RStudio

File explorer

DIY

21 / 40

website built

22 / 40

2) modify website

  1. config.toml
  2. content/
  3. static/
  4. themes/
23 / 40

2) modify website

  1. config.toml
  2. content/
  3. static/
  4. themes/

Documentation for the academic theme at: https://sourcethemes.com/academic/

23 / 40

2) modify website

config.toml

# Configuration of Academic
# Documentation: https://sourcethemes.com/academic/
#
# This file is formatted using TOML syntax - learn more at https://learnxinyminutes.com/docs/toml/
# Each configuration section is defined by a name in square brackets (e.g. `[outputs]`).
# Title of your site
title = "Academic"
# The URL of your site.
# End your URL with a `/` trailing slash, e.g. `https://example.com/`.
baseurl = "/"
# Enter a copyright notice to display in the site footer.
# To display a copyright symbol, type `©`. For current year, type `{year}`.
copyright = ""
############################
# Configuration of Academic
# Documentation: https://sourcethemes.com/academic/
#
# This file is formatted using TOML syntax - learn more at https://learnxinyminutes.com/docs/toml/
# Each configuration section is defined by a name in square brackets (e.g. `[outputs]`).
# Title of your site
title = "This is actually personalized!"
# The URL of your site.
# End your URL with a `/` trailing slash, e.g. `https://example.com/`.
baseurl = "/"
# Enter a copyright notice to display in the site footer.
# To display a copyright symbol, type `©`. For current year, type `{year}`.
copyright = ""
############################
24 / 40

2) modify website

content/

25 / 40

2) modify website

content/

25 / 40

2) modify website

content/

26 / 40

2) modify website

static/

27 / 40

2) modify website

themes/

28 / 40

website modified!

29 / 40
30 / 40

3) publish website

31 / 40

3) publish website

make a netlify account

Go to netlify.com and sign-up

31 / 40

3) publish website

make a netlify account

Go to netlify.com and sign-up

drag & drop the folder public

For updates go to Deploys and drag & drop public folder

31 / 40

website published

32 / 40

That's it!

33 / 40

open topics

  • Blogposts verfassen
  • GitHub Integration
  • Eigene Domain nutzen
  • Integration mit GitHub-Pages
35 / 40

Theme anpassen

36 / 40

Blogpost verfassen

37 / 40

GitHub Integration

  • GitHub Account erstellen
  • Netlify zugriff auf das Respository gewähren
    • Netlify kann die Seite mit einer eigenen HUGO-Engine generieren, oder
    • Seite lokal generieren (wie wir es eben getan haben)
  • GitHub push löst Deployment auf Netlify aus.
38 / 40

Eigene Domain nutzen

39 / 40

Integration mit GitHub-Pages

40 / 40

my web dev background

2 / 40
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow