mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-11 05:54:58 +00: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
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user