mirror of
https://github.com/TheThomaas/my-online-cookbook.git
synced 2026-01-11 20:21:49 +00:00
Workaround to allow commas inside ingredients
This commit is contained in:
parent
9b888a03b3
commit
31d3801b52
|
|
@ -61,8 +61,9 @@ module.exports = config => {
|
||||||
return value.toLowerCase();
|
return value.toLowerCase();
|
||||||
});
|
});
|
||||||
|
|
||||||
config.addFilter('asArray', function(value) {
|
// This workaround is needed so we can transform it back into an array with Alpine (we can't split on "," as it can be included within the items)
|
||||||
return value ? [...value] : []
|
config.addFilter('arrayToString', function(value) {
|
||||||
|
return value.join('£');
|
||||||
});
|
});
|
||||||
|
|
||||||
/* Shortcodes */
|
/* Shortcodes */
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
<a class="c-tags__tag" href="/tags/{{ tag | noEmoji | slug }}">{{ tag }}</a>
|
<a class="c-tags__tag" href="/tags/{{ tag | noEmoji | slug }}">{{ tag }}</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
<div class="c-recipe__ingredients-wrapper" x-data="{currentServings: {{ servings }}, ingredients: '{{ ingredients }}'.split(',') }">
|
<div class="c-recipe__ingredients-wrapper" x-data="{currentServings: {{ servings }}, ingredients: '{{ ingredients | arrayToString }}'.split('£') }">
|
||||||
{% if time or servings %}
|
{% if time or servings %}
|
||||||
<div class="c-recipe__additional-info">
|
<div class="c-recipe__additional-info">
|
||||||
{% if time %}
|
{% if time %}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ sourceLabel: BBC good food
|
||||||
sourceURL: https://www.bbcgoodfood.com/recipes/courgette-lemon-risotto/
|
sourceURL: https://www.bbcgoodfood.com/recipes/courgette-lemon-risotto/
|
||||||
ingredients:
|
ingredients:
|
||||||
- 50g butter
|
- 50g butter
|
||||||
- 1 onion finely chopped
|
- 1 onion, finely chopped
|
||||||
- 1 large garlic clove crushed
|
- 1 large garlic clove crushed
|
||||||
- 180g risotto rice
|
- 180g risotto rice
|
||||||
- 1 vegetable stock cube
|
- 1 vegetable stock cube
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue