Fix regression introduced when inlining "Required" (#2005)

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-26 18:51:24 +01:00 committed by GitHub
parent c16788f991
commit f3130f70e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

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