Markdownify ingredients list

This commit is contained in:
Théophile Bastian 2019-05-16 16:04:19 +02:00
parent bd401680c7
commit 7834094f7c

View file

@ -4,8 +4,8 @@
{{ with .Params.portions -}} {{ with .Params.portions -}}
<div class="ingred-portions"> <div class="ingred-portions">
pour {{ .qt }} pour {{ .qt | markdownify }}
{{- with .name }} {{.}} {{- with .name }} {{ . | markdownify }}
{{- else }} portions{{ end -}} {{- else }} portions{{ end -}}
</div> </div>
{{- end }} {{- end }}
@ -13,13 +13,13 @@
<ul> <ul>
{{ range $.Param "ingredients" }} {{ range $.Param "ingredients" }}
<li> <li>
<span class="ingred-qt">{{ with .qt }}{{ . }}{{ end }}</span> <span class="ingred-qt">{{ with .qt }}{{ . | markdownify }}{{ end }}</span>
{{ with .article -}} {{ with .article -}}
{{ . -}} {{ . | markdownify -}}
{{- if substr . -1 1 | eq "'" -}}{{ else }} {{ end -}} {{- if substr . -1 1 | eq "'" -}}{{ else }} {{ end -}}
{{/* ^^^ No space only if article ends with an apostrophe */}} {{/* ^^^ No space only if article ends with an apostrophe */}}
{{- end -}} {{- end -}}
<span class="ingred-name">{{ .name }}</span> <span class="ingred-name">{{ .name | markdownify }}</span>
</li> </li>
{{ end }} {{ end }}
</ul> </ul>