Markdownify ingredients list

This commit is contained in:
Théophile Bastian 2019-05-16 16:04:19 +02:00
parent bd401680c7
commit 7834094f7c
1 changed files with 5 additions and 5 deletions

View File

@ -4,8 +4,8 @@
{{ with .Params.portions -}}
<div class="ingred-portions">
pour {{ .qt }}
{{- with .name }} {{.}}
pour {{ .qt | markdownify }}
{{- with .name }} {{ . | markdownify }}
{{- else }} portions{{ end -}}
</div>
{{- end }}
@ -13,13 +13,13 @@
<ul>
{{ range $.Param "ingredients" }}
<li>
<span class="ingred-qt">{{ with .qt }}{{ . }}{{ end }}</span>
<span class="ingred-qt">{{ 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 }}</span>
<span class="ingred-name">{{ .name | markdownify }}</span>
</li>
{{ end }}
</ul>