R/remove_post.R

#' @title Remove a post
#' @description \code{remove_post} removes a post
#' @param post path to the post
#' @return The directory \code{post} is removed if it exists.
#' @seealso \code{\link{new_post}, \link{tag_post}, \link{render_post}}
#' @examples 
#' new_post("Hello, world!", "hello-world")
#' remove_post(post_dir(Sys.Date(), "hello-world"))
#' @export 
remove_post <- function(post) {
    if (dir.exists(post)) {
        unlink(post, recursive = TRUE, force = TRUE)
    }
}
dnegrey/blogr documentation built on May 15, 2019, 9:38 a.m.