mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-22 21:42:50 +02:00
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.
This commit is contained in:
@@ -98,7 +98,7 @@ func NewContent(kind, name string) (err error) {
|
|||||||
return err
|
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)
|
newmetadata["date"] = time.Now().Format(time.RFC3339)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user