add frontmatter to options

pull/144/head
Henrique Dias 2016-06-29 10:43:13 +01:00
parent b984437b2b
commit b00061a9b2
1 changed files with 8 additions and 0 deletions

View File

@ -44,6 +44,14 @@ func Parse(c *caddy.Controller) ([]Config, error) {
}
cfg.PathScope = c.Val()
cfg.PathScope = strings.TrimSuffix(cfg.PathScope, "/")
case "frontmatter":
if !c.NextArg() {
return configs, c.ArgErr()
}
cfg.FrontMatter = c.Val()
if cfg.FrontMatter != "yaml" && cfg.FrontMatter != "json" && cfg.FrontMatter != "toml" {
return configs, c.Err("frontmatter type not supported")
}
case "on":
if !c.NextArg() {
return configs, c.ArgErr()