Эх сурвалжийг харах

Add alternative ingredient option to shortcode

The shortcode now has an optional `alternative` option that can be used
to add an alternative for the ingredient.
Bee Hudson 6 сар өмнө
parent
commit
786aedf96a

+ 8 - 1
layouts/shortcodes/recipeIngredient.html

@@ -1 +1,8 @@
-<li class="p-ingredient">{{ .Get "text" -}}</li>
+<li class="p-ingredient">
+    {{ .Get "text" -}}
+    {{- with .Get "alternative" -}}
+    <ul>
+        <li class="p-ingredient">{{ . | markdownify }}</li>
+    </ul>
+    {{- end -}}
+</li>