New distill site in 15 minutes

Distill is so much easier than blogdown

David Harper

Goodbye Blogdown (+hugo), hello Distill

My current (soon to be previous) data blog is a blogdown site. The setup/installation of blogdown was not difficult, but it is a PITA to maintain; e.g., new ggplot images aren’t rendering on the last package update. On Sunday after hours trying to fix the blogdown configuration, I even resorted to hiring quick help at for the first time in my life, but even their expert could not fix the problem. The first time it was pretty straightforward, and it should still be, but after searching to debug my problem, I observed that I was not alone in my frustration with blogdown. I figured, there MUST be a better way to simply share data analyses (without going to Rpubs, I mean)?

Then I stumbled onto Lisa Lendway’s post. She also had a “blogdown fail!” and she explains why she switched to the distill package. How did I miss this revelation?! Boom. This setup here took me a grand total of 15 minutes to install. No glitches! Distill is light-weight and somewhat customizable; e.g., I borrowed the tidymodels.css stylesheet and changed my titles to CeriFi’s color (#193053) because, you know, color makes me happy. No mess. No fuss. Here are the basic steps:

  1. Install distill package and build site with create_website (ype, one line of code!)
  2. Create a local git repo (at the distill directory just created) and connect that to a remote GitHub repo; mine is here. So this github repo is remote a copy of the webite
  3. Use the netlify to publish from the _site sub-directory. Netflify is amazing.

Adding a blog entry is easy:

  1. create_post(title = “I love distill because it’s easy and it works!”) which is an RMarkdown file
  2. Knit the post (to view locally); article must be knitted individually
  3. When ready, “Build Website” in RStuio’s Build pane; i.e., executes rmarkdown::render_site()
  4. Commit and push to github. Netlify allows for continous deployment if you build from the github repo and specify _site as the Publish directory

Distill’s lightweight file structure

With the command create_website(), a simple file structure is created:

create_website() installs these files

The _site.yml contains the reference to the theme.css. I borrowed the tidymodels.css theme with only a color change.

_site.yml controls details

My About page is courtesy of Alison Hill’s tutorial; in <3 minutes, I installed the postcard package and switched the page’s style to trestles with a quick edit to the YAML

article’s YAML front-matter with built-in trestles theme