diff options
author | spf13 <[email protected]> | 2014-05-29 18:40:16 -0400 |
---|---|---|
committer | spf13 <[email protected]> | 2014-05-29 18:45:19 -0400 |
commit | b9bba2b977256642d00938e317cc2b743c418e6e (patch) | |
tree | a975942afdd4bab9d94b9984001aef899abca27d /create | |
parent | 0c2544608cfae1e272da252c383c8fa72634eed7 (diff) | |
download | hugo-b9bba2b977256642d00938e317cc2b743c418e6e.tar.gz hugo-b9bba2b977256642d00938e317cc2b743c418e6e.zip |
Updating Convert to handle dates properly for yaml and json
Fix bug with YAML & JSON with handling dates with 'new' and 'convert'
Diffstat (limited to 'create')
-rw-r--r-- | create/content.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/create/content.go b/create/content.go index 1f198b5c6..01a1c9aac 100644 --- a/create/content.go +++ b/create/content.go @@ -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"))) |