From 358c5e76d67477b26d841985649b9279d7633fc3 Mon Sep 17 00:00:00 2001 From: xengineering Date: Mon, 1 May 2023 18:07:55 +0200 Subject: Switch to tripel to describe ingredients It is always the same: - amount float32 - unit string - type string This is good as a starting point. Later the types of ingredients might have to be tracked. In this a string as key is maybe not the best. --- data/templates/recipe.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'data/templates/recipe.html') diff --git a/data/templates/recipe.html b/data/templates/recipe.html index bec6eb5..a91f025 100644 --- a/data/templates/recipe.html +++ b/data/templates/recipe.html @@ -22,7 +22,7 @@ {{range .Recipe.Steps}}

{{.Text}}

-

{{range $i, $el := .Ingredients}}{{if $i}}, {{end}}{{$el.Amount}} {{$el.Type}}{{end}}

+

{{range $i, $el := .Ingredients}}{{if $i}}, {{end}}{{if ne $el.Amount 0.0}}{{$el.Amount}} {{end}}{{if ne $el.Unit ""}}{{$el.Unit}} {{end}}{{$el.Type}}{{end}}

{{end}} -- cgit v1.2.3-70-g09d2