diff options
Diffstat (limited to 'resources/resource/resource_helpers.go')
-rw-r--r-- | resources/resource/resource_helpers.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/resources/resource/resource_helpers.go b/resources/resource/resource_helpers.go index 29f783ce3..90075f983 100644 --- a/resources/resource/resource_helpers.go +++ b/resources/resource/resource_helpers.go @@ -18,6 +18,7 @@ import ( "time" "github.com/gohugoio/hugo/helpers" + "github.com/pelletier/go-toml/v2" "github.com/spf13/cast" ) @@ -55,6 +56,10 @@ func getParam(r Resource, key string, stringToLower bool) any { return cast.ToFloat64(v) case time.Time: return val + case toml.LocalDate: + return val.AsTime(time.UTC) + case toml.LocalDateTime: + return val.AsTime(time.UTC) case []string: if stringToLower { return helpers.SliceToLower(val) @@ -65,6 +70,5 @@ func getParam(r Resource, key string, stringToLower bool) any { case map[any]any: return v } - return nil } |