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>
This commit is contained in:
Kévin Commaille 2024-11-19 11:19:59 +01:00
parent c5d7eb7a2d
commit 5c7d5eb3db
No known key found for this signature in database
GPG key ID: 0C971D9DBC9D678D

View file

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