autoportrait

distill

Documenting how this blog was set up

Peter Yao
07-31-2021

This blog was set up following the instructions from Alison Hill. To make the rest of the site match the About Me page better (created with the postcards package), I added a bit to the site styles.css, which I expect I will play with more in the future.

@import url("https://fonts.googleapis.com/css2?family=Roboto+Slab&display=swap");

h1, h2, h3, h4, h5, h6 {
  font-family: "Roboto Slab";
}

body {
  font-family: "Roboto Slab";
  background-color: #f5e9dd;
}

At the moment there is a slight difference in how the navbar looks on the pages. Hopefully I can figure out how to fix that at some point.

I wanted to try to use the same data source I used for my CV, which I partially made using the vitae package–I say partially, because I ended up fine tuning it directly in the LaTeX file. It’s a bit hacky but works. Below is for the “Experience” section.

library("glue")

data_source_root <- "https://raw.githubusercontent.com/peterjyao/cv/main/data"

experience <- read.csv(url(glue("{data_source_root}/experience.csv")))

# fix the date formatting
experience$dates <- gsub("\'", "20", experience$dates)
experience$dates <- gsub("-", " - ", experience$dates)

experience$description_formatted <- glue(
    .envir = experience,
    "**{role}**&nbsp;&nbsp;|&nbsp;&nbsp;{dates}",
    "*{org}*&nbsp;&nbsp;|&nbsp;&nbsp;{place}",
    "{description}",
    .sep = "<br>"
  )

cat(paste(experience$description_formatted, collapse = "<br><br>"))

I used similar code for the “Education” and “Languages” section, so I should probably make a function out of it.

Edit: I continually play around with the site colors as well as the formatting in the About page, so most of this description is outdated. Anyone really curious (i.e. no one) can check out the repository for the latest version.