-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tokyo_R_presentation.Rmd
146 lines (123 loc) · 3.63 KB
/
Tokyo_R_presentation.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
---
title: "Creating your own website/ blog with R"
subtitle: "An intro to the `blogdown`-package"
author: "Henning Bumann @ Tokyo.R"
date: "2017/04/01"
output:
xaringan::moon_reader:
# css: "my-theme.css"
# chakra: libs/remark-latest.min.js
# lib_dir: libs
nature:
highlightStyle: github
highlightLines: true
countIncrementalSlides: false
---
```{r setup, include=FALSE}
options(htmltools.dir.version = FALSE)
```
# Many reasons to set up a website or blog
- document projects
- contribute to community
- build a portfolio
- practice writing
- learn about web technology
--
## But it should be simple...
- ... to set up,
- ... to use and
- ... to publish!
???
Why should you consider a blog?
- web is/ should be about collaboration, freedom and sharing (not surveillance)
- you want to contribute, you need some kind of plattform to do so.
- But it would be nice to be able to share R code with others!
- I guess, most of us use RStudio for working with R and many of us wil use git and github to control and possibly share our source code. RStudio provides extensive support for literate programming and reproducable research via the `knitr` and `rmarkdown` packages.
- easily contribute to R-bloggers or other blog aggregators
---
# Choose the right tool for the job!
.pull-left[
## Hugo
- *very fast* static site generator written in Go
- seperates content and design
- secure compared to CMS
- good performance
]
--
.pull-right[
## RMarkdown
- powerful literate programming tool
- almost native solution for RStudio
- offers *many* possible output formats
]
--
### 🢣 `blogdown`-package by [Yihui Xie](https://github.com/yihui)!
---
class: inverse, center
background-image: url(https://proquestionasker.github.io/blog/img/SiteTutorial.jpg)
background-size: 600px
# Demotime!
.footnote[
*Image-Credit: [Amber Thomas](https://proquestionasker.github.io/blog/Making_Site/)*
]
---
# (Creating a Website locally)
### Install Hugo
```{r, eval=FALSE}
devtools::install_github("Rstudio/blogdown")
library(blogdown)
install_hugo() # install Hugo
```
### Create Website
```{r, eval=FALSE}
new_site(theme = "frjo/hugo-theme-zen") # create website
new_post("tokyo.R", rmd = TRUE)
```
### Build (and publish)
```{r, eval=FALSE}
build_site()
```
???
- Create site needs a empty folder
- explain `options(servr.daemon = TRUE)`
---
# Why I like `blogdown`
.pull-left[
### great
- very easy to set up and use
- Hugo is very fast!
- allows to write blogposts from the comfort of your favorite editor. ;-)
- great variability of easy to install themes
- all the features of (html-)rmarkdown can be used
]
.pull-right[
### almost great
- publication could be even more streamlined
- not possible to add content outside of the editor
]
---
# I hope, you will build your own site soon!
```{r, out.width = "600px", echo = FALSE, fig.align='center'}
knitr::include_graphics("images/any_questions_mem.jpeg")
```
???
- I shope you will also create a blogdown page soon (and tell me about it)
- if you come to Germany in the future, please get in touch!
---
# References
- Github-repo for this talk: <br>
- https://github.com/henningsway/Tokyo.R
- `blogdown`-repo:
- https://github.com/rstudio/blogdown
- Blogposts on using blogdown:
- *Publishing to githubpages:* <br>
https://proquestionasker.github.io/blog/Making_Site/
- *2-repo-approach:* <br>
https://tclavelle.github.io/
- *Subtree-approach:* <br>
https://hjdskes.github.io/blog/update-deploying-hugo-on-personal-gh-pages/
- Hugo
- https://themes.gohugo.io/ (Themes)
- https://gohugo.io/overview/introduction/ (Documentation)
- RMarkdown:
- https://rmarkdown.rstudio.com/