Skip to content

Commit

Permalink
trmnl
Browse files Browse the repository at this point in the history
  • Loading branch information
clarklab committed Feb 3, 2025
1 parent 7ed4ad7 commit 40f14a1
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions trmnl.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---
---
{% for post in site.recipes %}
{

"title" : "{{ post.title | escape }}",
{% if post.ingredients %}"ingredients" : "{% for ingredient in post.ingredients %}{{ ingredient | escape }}, {% endfor %}",{% endif %}
{% if post.tags %}"tags" : "{% for tag in post.tags %}{{ tag | escape }} {% endfor %}",{% endif %}
"image" : "{{ site.baseurl }}/images/{{ post.image }}",
"url" : "{{ site.baseurl }}{{ post.url }}"

} {% unless forloop.last %},{% endunless %}
{% endfor %}
{% assign shuffled_recipes = site.recipes | sort: "title" | sort: "random" %}
{% assign random_recipe = shuffled_recipes | first %}

{
"title" : "{{ random_recipe.title | escape }}",
{% if random_recipe.ingredients %}"ingredients" : "{% for ingredient in random_recipe.ingredients %}{{ ingredient | escape }}, {% endfor %}",{% endif %}
{% if random_recipe.tags %}"tags" : "{% for tag in random_recipe.tags %}{{ tag | escape }} {% endfor %}",{% endif %}
"image" : "{{ site.baseurl }}/images/{{ random_recipe.image }}",
"url" : "{{ site.baseurl }}{{ random_recipe.url }}"
}

0 comments on commit 40f14a1

Please sign in to comment.