mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-19 21:21:39 +02:00
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:
@@ -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")))
|
||||
|
||||
|
Reference in New Issue
Block a user