Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/create
diff options
context:
space:
mode:
authorspf13 <steve.francia@gmail.com>2014-05-30 02:40:16 +0400
committerspf13 <steve.francia@gmail.com>2014-05-30 02:45:19 +0400
commitb9bba2b977256642d00938e317cc2b743c418e6e (patch)
treea975942afdd4bab9d94b9984001aef899abca27d /create
parent0c2544608cfae1e272da252c383c8fa72634eed7 (diff)
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.go4
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")))