From: Anthony Fok Date: Sun, 8 Feb 2015 16:50:01 +0000 (-0700) Subject: parser.FormatSanitize() MetaDataFormat for date too X-Git-Tag: v0.13~61 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=088d46a804fc9345203fdcf90964b195775fa0e0;p=brevno-suite%2Fhugo parser.FormatSanitize() MetaDataFormat for date too So that the date would come out correctly with variations like `MetaDataFormat = "YAML"` in addition to the normally expected `MetaDataFormat = "yaml"`. Fixes #865. --- diff --git a/create/content.go b/create/content.go index 98b3652a..fa37f266 100644 --- a/create/content.go +++ b/create/content.go @@ -98,7 +98,7 @@ func NewContent(kind, name string) (err error) { return err } - if x := viper.GetString("MetaDataFormat"); x == "json" || x == "yaml" || x == "toml" { + if x := parser.FormatSanitize(viper.GetString("MetaDataFormat")); x == "json" || x == "yaml" || x == "toml" { newmetadata["date"] = time.Now().Format(time.RFC3339) }