-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Description
What version of Hugo are you using (hugo version)?
$ hugo version 0.152.0
Does this issue reproduce with the latest release?
Yes, it first occured with the latest release
Description
Previously, integer-Params defined in the Front-Matter could be added directly to a date with AddDate 0 0 .Params.int_param. This is broken in 0.152.0 since the param is now parsed as uint64 and AddDate expects an int
Example Code
Front-Matter:
---
title: Homepage
test_param_int: 4
---
list.html:
{{ $test_date := time.Now }}
Date + 2: {{ $test_date.AddDate 0 0 2 | time.Format ":date_medium" }}<br> {{/* <- works */}}
Date + Param.test_param_int: {{ $test_date.AddDate 0 0 (.Params.test_param_int) | time.Format ":date_medium" }}<br> {{/* <- breaks */}}
Error message:
ERROR Rebuild failed: render: failed to render pages: render of "/srv/hugo/content/_index.md" failed: "/srv/hugo/layouts/list.html:8:65": execute of template failed at <.Params.test_param_int>: wrong type for value; expected int; got uint64