Ver Fonte

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 há 6 meses atrás
pai
commit
786aedf96a
1 ficheiros alterados com 8 adições e 1 exclusões
  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>