#' Make markdown files for talks
#'
#' This function will create markdown files in the Hugo Academic style for talks
#' specified in a Google Sheet.
#'
#' @param dir The directory you would like the markdown documents to be saved in
#' @param id Your Google Sheet id
#' @export
make_talk_md <- function(dir, id = "1-PItelqpv0Sb_LdiEDqb8O3D_Roii5nVTL07IRVbRtA") {
d <- googlesheets4::range_read(googlesheets4::as_sheets_id(id))
d <- d[d$manual == 0, ]
md <- glue::glue_data(d, {
"+++
## Generated by the R package lazyacademic
## Do not edit directly, edit the Google Sheet [id = (id)]
title = \"(title)\"
event = \"(where)\"
time_start = (start)
time_end = (end)
abstract = \"(abstract)\"
url_custom = [{name = \"Link\", url = \"(link)\"}]
+++
"
}, .open = "(", .close = ")")
file_base <- tolower(gsub(" ", "_", d$where))
file_name <- glue::glue("{dir}/{file_base}.md")
purrr::walk2(md, file_name, writeLines)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.