Fix regression introduced when inlining "Required" with description

If the description is not set in the object definition, Hugo generates a weird string after "Required": `%!s(<nil>)`.

To avoid that, we default the description to an empty string when it is not set.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
pull/2005/head
Kévin Commaille 3 days ago
parent c5d7eb7a2d
commit 5c7d5eb3db
No known key found for this signature in database
GPG Key ID: 0C971D9DBC9D678D

@ -313,7 +313,7 @@ resolve-additional-types.)
Prepend "Required:" to make it part of the first paragraph of the Prepend "Required:" to make it part of the first paragraph of the
description. description.
*/}} */}}
{{- $description = printf "<strong>Required: </strong>%s" $description -}} {{- $description = printf "<strong>Required: </strong>%s" (default "" $description) -}}
{{ end -}} {{ end -}}
{{/* {{/*
Force the rendering as a block so the description is always inside a Force the rendering as a block so the description is always inside a

Loading…
Cancel
Save