Avoid printing "()" if the ingredient doesn't have a quantity

This commit is contained in:
Miguel de la Cruz 2024-07-06 20:38:19 +02:00
parent e871c5c3d5
commit e52d17f257

View file

@ -34,7 +34,7 @@
<ul> <ul>
{{range .recipe.Steps}} {{range .recipe.Steps}}
{{range .Ingredients}} {{range .Ingredients}}
<li>{{.Name}} ({{.Amount.QuantityRaw}}{{if ne .Amount.Unit ""}} {{.Amount.Unit}}{{end}})</li> <li>{{.Name}} {{if ne .Amount.QuantityRaw ""}}({{.Amount.QuantityRaw}}{{if ne .Amount.Unit ""}} {{.Amount.Unit}}{{end}}){{end}}</li>
{{end}} {{end}}
{{end}} {{end}}
</ul> </ul>