Browse Source

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 months ago
parent
commit
786aedf96a
1 changed files with 8 additions and 1 deletions
  1. 8 1
      layouts/shortcodes/recipeIngredient.html

+ 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>