whisker: Render whisker templates.

Description Usage Arguments Details Examples

View source: R/plugin-whisker.R

Description

Any files matching pattern, and containing a template entry in their metadata will have their contents replaced by the template processed by whisker.render.

Usage

1
whisker(pattern = "\\.html$", template_dir = "templates")

Arguments

pattern

Regular expression describing patterns to process.

template_dir

Directory in which to look for templates. Relative to site base directory.

Details

Metadata in the page metadata is available as is. Site metadata is available with the prefix site..

Uses moustache syntax: http://mustache.github.io/.

Examples

1
2
3
static_site <- rsmith_demo("static-site")
static_site %>% use(markdown()) %>% preview()
static_site %>% use(markdown()) %>% use(whisker(".html")) %>% preview()

hadley/rsmith documentation built on May 17, 2019, 12:16 p.m.