new_post: File Structure for a Jekyll Blog Post

Description Usage Arguments Details

Description

A function to set-up the file structure for a Jekyll blog post. Assumes that the current working directory is the root directory of the Jekyll site.

Usage

1
2
3
new_post(title = "new post", date = as.character(Sys.Date()),
  serve = TRUE, dir = "_source", subdir = TRUE,
  skeleton_file = ".skeleton_post.Rmd")

Arguments

title

The title of the blog post

date

The date to show the post was published. Defaults to as.character(Sys.Date())

serve

Should blog_serve be run once the files have been set-up? Defatuls to TRUE.

dir

The directory the post (or subdirectory) should reside in

subdir

Should the post live in a subdirectory? Defaults to TRUE

skeleton_file

The filepath of a skeleton blog post which will be used as the basis for the basis for the newly created file

Details

new_post will create a .R file, and a .Rmd file (by default in a subdirectory), with names created by running title through filenamize. The .R file will contain a short note mentioning that it accompanies the .Rmd file, which will contain the same text as the file supplied by skeleton_post paramter. Both files will be opened using sys_open.


brlancer/blance documentation built on May 13, 2019, 7:44 a.m.