mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
added evaluation for toml for metadataformat date handling
This commit is contained in:
parent
27c0ec3163
commit
b10dea2955
2 changed files with 2 additions and 2 deletions
|
@ -117,7 +117,7 @@ func convertContents(mark rune) (err error) {
|
|||
}
|
||||
|
||||
// better handling of dates in formats that don't have support for them
|
||||
if mark == parser.FormatToLeadRune("json") || mark == parser.FormatToLeadRune("yaml") {
|
||||
if mark == parser.FormatToLeadRune("json") || mark == parser.FormatToLeadRune("yaml") || mark == parser.FormatToLeadRune("toml") {
|
||||
newmetadata := cast.ToStringMap(metadata)
|
||||
for k, v := range newmetadata {
|
||||
switch vv := v.(type) {
|
||||
|
|
|
@ -90,7 +90,7 @@ func NewContent(kind, name string) (err error) {
|
|||
return err
|
||||
}
|
||||
|
||||
if x := viper.GetString("MetaDataFormat"); x == "json" || x == "yaml" {
|
||||
if x := viper.GetString("MetaDataFormat"); x == "json" || x == "yaml" || x == "toml" {
|
||||
newmetadata["date"] = time.Now().Format(time.RFC3339)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue