Updating Convert to handle dates properly for yaml and json

Fix bug with YAML & JSON with handling dates with 'new' and 'convert'
This commit is contained in:
spf13
2014-05-29 18:40:16 -04:00
parent 0c2544608c
commit b9bba2b977
4 changed files with 25 additions and 1 deletions

View File

@@ -90,6 +90,10 @@ func NewContent(kind, name string) (err error) {
return err
}
if x := viper.GetString("MetaDataFormat"); x == "json" || x == "yaml" {
newmetadata["date"] = time.Now().Format(time.RFC3339)
}
page.Dir = viper.GetString("sourceDir")
page.SetSourceMetaData(newmetadata, parser.FormatToLeadRune(viper.GetString("MetaDataFormat")))