Improve details on the recipe template
This commit is contained in:
parent
055358f2db
commit
e871c5c3d5
3 changed files with 40 additions and 8 deletions
|
@ -15,14 +15,28 @@
|
|||
<img class="recipeimage" src="{{$recipeImage}}" />
|
||||
{{end}}
|
||||
|
||||
{{if ne (len .recipe.Steps) 0}}
|
||||
{{if ne (len .recipe.Metadata) 0}}
|
||||
<ul>
|
||||
{{range $k, $v := .recipe.Metadata}}
|
||||
<li><em>{{$k}}:</em> {{$v}}</li>
|
||||
{{$m := .recipe.Metadata}}
|
||||
{{$nameKey := .nameKey}}
|
||||
{{range $k := sortedMetadataKeys $m}}
|
||||
{{if ne $k $nameKey}}
|
||||
<li><em>{{$k}}:</em> {{index $m $k}}</li>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</ul>
|
||||
{{end}}
|
||||
|
||||
{{recipeSteps .recipe .path}}
|
||||
|
||||
<h2>{{.ingredientsTitle}}</h2>
|
||||
|
||||
<ul>
|
||||
{{range .recipe.Steps}}
|
||||
{{range .Ingredients}}
|
||||
<li>{{.Name}} ({{.Amount.QuantityRaw}}{{if ne .Amount.Unit ""}} {{.Amount.Unit}}{{end}})</li>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue