From 7ca5b93fb2c1499edbacc132926f79278e550d1f Mon Sep 17 00:00:00 2001
From: Patrick Spek
Date: Sat, 23 Apr 2022 13:00:38 +0200
Subject: Use labels and input ids
Thanks sircmpwn for the feedback.
This allows the user to click on the labels in order to check the
checkboxes associated with them. This should improve usability.
---
layouts/recipes/single.html | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
(limited to 'layouts/recipes')
diff --git a/layouts/recipes/single.html b/layouts/recipes/single.html
index 36981ce..01b0bd2 100644
--- a/layouts/recipes/single.html
+++ b/layouts/recipes/single.html
@@ -39,29 +39,30 @@
- {{- range .Params.ingredients }}
+ {{- range $i, $ingredient := .Params.ingredients }}
-
+
-
{{ .label }}
+
{{- if .unit }}
-
{{ .amount }}
-
{{ .unit }}
+
{{ .amount }}
+
{{ $ingredient.unit }}
{{- else }}
-
{{ .amount }}
+
{{ $ingredient.amount }}
{{- end }}
{{- end }}
Instructions
- {{- range .Params.stages }}
-
{{ .label }}
+ {{- range $i, $stage := .Params.stages }}
+
{{ $stage.label }}
- {{- range .steps }}
+ {{- range $j, $step := $stage.steps }}