{{define "recipe"}} {{- $hasIngredients := false -}} {{- range .Steps -}} {{- if gt (len .Ingredients) 0 -}} {{- $hasIngredients = true -}} {{- end -}} {{- end -}} {{ template "head" }}
{{ template "nav" }}

{{.Title}}

{{ if ne .Notes "" }}

{{.Notes}}

{{end}}{{ if ne .Portions "" }}

Portions: {{.Portions}}

{{end}}{{ if ne .Url "" }}

Original recipe: link

{{end}} {{if $hasIngredients}}

Ingredient summary:

{{end}}{{range .Steps}}

{{.Text}}

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

{{end}}
{{ template "footer" }} {{end}}