--- tags: ResBaz2021 --- # Blogdown: Creating Websites with R Markdown ## Thursday, May 20th, 2021 9\:00-11\:00 [Back to Resbaz HackMD Directory](https://hackmd.io/@ResBaz21/directory) Want to build a website using RStudio? blogdown is an R package that allows you to create websites from RMarkdown files using Hugo, an open-source static site generator. I’ll show you how to get your own website running and give you the tools you need to write your own posts. ## Getting Started :wrench: - Sign up for a [Netlify](https://app.netlify.com/signup) account - Install [R](https://www.r-project.org/) and [RStudio](https://www.rstudio.com/products/rstudio/download/) and [integrate RStudio with GitHub](https://cfss.uchicago.edu/setup/git-with-rstudio/) - Check out my personal [blogdown website](https://heidiesteiner.netlify.app/) --- ## Introductions :wave: Name (pronouns), Affiliation, Title, Email, Social Media, emoji - Heidi Steiner (she/her), University of Arizona, PhD Student/Workshop Instructor, heidiesteiner@email.arizona.edu, @hidyverse, :star-struck: - Jung Mee Park, University of Arizona, MLIS student library and information science at UA, PhD in sociology from Cornell, jmpark@email.arizona.edu, @jpark1917 (https://twitter.com/jpark1917) - Rene Dario Herrera (they/them), University of Arizona Cancer Center, Data Analyst, renedherrera@email.arizona.edu, [twitter@reneherrera](https://twitter.com/reneherrera), [github@renedarioherrera](https://github.com/renedarioherrera), [linkedin.com@renedarioherrera/](https://www.linkedin.com/in/renedarioherrera/) ## Copy and Paste Code Chunks :scissors: ```{r} install.packages("blogdown") ``` ```{r eval = F} library(blogdown) ``` ```{r eval = FALSE} new_site(theme = "gcushen/hugo-academic", sample = TRUE, theme_example = TRUE, empty_dirs = TRUE, to_yaml = TRUE) ``` ```{r eval = F} hugo_version() ``` ```{r eval = F} blogdown::install_hugo(force = T) ``` ```{r} file.create("netlify.toml") ``` ```{r eval = F} [build] publish = "public" command = "hugo" [context.production.environment] HUGO_VERSION = "0.83.1" HUGO_ENV = "production" HUGO_ENABLEGITINFO = "true" [context.branch-deploy.environment] HUGO_VERSION = "0.83.1" [context.deploy-preview.environment] HUGO_VERSION = "0.83.1" ``` ```{r eval = F} .Rproj.user .Rhistory .RData .Ruserdata public/ .DS_Store # if a windows user, Thumbs.db instead ``` ## Questions and Answers :question: In this section, you can post your questions and feel free to answer if you have it. Questions will be answered during or after the workshop. 1. What is blogdown? - An R package that lets you create websites in RStudio ussing a static site generator named Hugo. 2. Why use blogdown? - Own your content - Use R Markdown to create content - RStudio integration - Hugo themes - Agnostic publishing 3. I joined late. Is there a link to the code? - Step by step instructions (from the slides) can be found [here](https://github.com/heidiesteiner/resbaz2021/blob/main/blogdownwebsite.Rmd) and a similar tutorial can be found [here](https://www.emmanuelteitelbaum.com/post/create-a-website-with-blogdown-and-hugo) 4. Must I use the Academic theme? - More themes can be found [here](https://themes.gohugo.io/tags/personal/) *at your own caution*. Each theme has idiosyncracies - the Academic theme is used frequently and therefore has tons of documentation. --- :::info **Session Feedback :mega:** Use the link below to provide your feedback on the session: [**Session Feedback Form**](https://forms.gle/TrnJpr9qRBEKdnVVA) :::