class: center, middle, inverse, title-slide .title[ # Creating three types of websites with blogdown ] .author[ ###
Yihui Xie
, RStudio PBC ] .date[ ### 2022/04/07 @ Department of Statistics, Miami University ] --- ## Prerequisites For this talk, I assume that you - have installed R, RStudio, and the blogdown package - know what R Markdown is - have a Github account ([github.com](https://github.com)) - have installed and configured Git so that you are able to push to Github --- .center[![:image 45%, R Markdown: The Definitive Guide](https://bookdown.org/yihui/rmarkdown/images/cover.png)] (2018) https://bookdown.org/yihui/rmarkdown/ --- .center[![:image 45%, R Markdown: The Definitive Guide](https://bookdown.org/yihui/rmarkdown-cookbook/images/cover.png)] (2020) https://bookdown.org/yihui/rmarkdown-cookbook/ --- ## The R Markdown ecosystem - bookdown: https://bookdown.org/yihui/bookdown/ - blogdown: https://bookdown.org/yihui/blogdown/ - pagedown: https://github.com/rstudio/pagedown - rticles: https://github.com/rstudio/rticles - tufte: https://github.com/rstudio/tufte - flexdashboard: https://github.com/rstudio/flexdashboard - xaringan: https://github.com/yihui/xaringan - shower: https://github.com/shower/shower --- ## The R Markdown ecosystem - distill: https://github.com/rstudio/distill - learnr: https://github.com/rstudio/learnr - pkgdown: https://github.com/r-lib/pkgdown - htmlwidgets: https://github.com/ramnathv/htmlwidgets - prettydoc: https://github.com/yixuan/prettydoc - minidown: https://github.com/atusy/minidown - rmdformats: https://github.com/juba/rmdformats - ... --- ## A quick introduction to pagedown - A package to created paginated HTML output, i.e., a web page that can be printed as multiple pages like PDF (with header/footer, etc) - Main features - (HTML) Output formats: paged HTML document, thesis, journal article, resume, poster, letter, etc https://github.com/rstudio/pagedown - `pagedown::chrome_print()` to convert `.Rmd` or `.html` files to PDF via Google Chrome / Chromium / Microsoft Edge --- ## Creating websites with blogdown - I will demonstrate three themes: [yihui/hugo-xmin](https://github.com/yihui/hugo-xmin) (minimal/simple), [yihui/hugo-prose](https://github.com/yihui/hugo-prose) (intermediate), [hugo-apero/hugo-apero](https://github.com/hugo-apero/hugo-apero) (sophisticated) - RStudio: File -> New Project -> New Directory -> Website using blogdown - Play with the new site --- ## Git/Github - Authentication (if you haven't done it before) ```r # install usethis if necessary xfun::pkg_load2('usethis') usethis::create_github_token() gitcreds::gitcreds_set() ``` - Initialize a Git repository locally, and push to Github ```r usethis::use_git() # Commit files? No; Restart? Yes usethis::use_github() # Create a Github repo ``` --- ## Netlify - Sign in Netlify ([app.netlify.com](https://app.netlify.com)) - Create a site there from the Git repo - Change the random domain to a more meaningful one - You have got a personal website! --- class: center, middle # Questions? RStudio Community (https://community.rstudio.com) or Stack Overflow (https://stackoverflow.com) ## Thank you! ## [slides.yihui.org/2022-Miami-U.html](https://slides.yihui.org/2022-Miami-U.html)