nomnom/layouts/partials/ingredients_ul.html
2021-12-17 19:56:29 +01:00

26 lines
658 B
HTML

<ul>
{{- range . }}
{{ if isset . "catname" }}
</ul>
<h2>{{ .catname | markdownify }}</h2>
{{ partial "ingredients_ul.html" .ingredients }}
<ul>
{{ else }}
<li>
<span
class="ingred-qt{{ with .qt -}}
{{ if eq . "QS" }} with_abbrv" title="Quantité Suffisante{{ end }}
{{- end }}">{{ with .qt }}{{ . | markdownify }}{{ end }}</span>
{{ with .article -}}
{{ . | markdownify -}}
{{- if substr . -1 1 | eq "'" -}}{{ else }} {{ end -}}
{{/* ^^^ No space only if article ends with an apostrophe */}}
{{- end -}}
<span class="ingred-name">{{ .name | markdownify }}</span>
</li>
{{ end }}
{{ end -}}
</ul>