pin_file_extension <- function(x) {
extension <- tools::file_ext(x)
if (nchar(extension) == 0) extension <- "txt"
paste0(".", extension)
}
pin_file_cache_max_age <- function(cache_control) {
if (is.null(cache_control)) return(NULL)
max_age <- grep("max-age", cache_control)
if (length(max_age) != 1) return(NULL)
as.numeric(gsub(".*max-age=", "", cache_control))
}
#' @keywords internal
#' @export
pin.character <- function(x, name = NULL, description = NULL, board = NULL, ...) {
board_pin_store(board_get(board), x, name, description, "files", list(), ...)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.