2020-02-29 16:07:24 +00:00
---
title: Home
layout: default
---
2020-03-06 13:20:21 +00:00
{%- if site.recipes.size > 1 %}
2020-03-03 16:54:37 +00:00
< h2 class = 'no-bg' > Recipes< / h2 >
< p class = 'subtle' > Showing {% if site.recipes_per_page > site.recipes.size %}{{ site.recipes_per_page}}{% else %}{{ site.recipes.size }}{% endif %} results.< / p >
2020-02-29 18:05:06 +00:00
{% include recipes.html %}
2020-03-03 16:54:37 +00:00
< h2 class = 'no-bg' > Stats< / h2 >
{%- assign steps_total = 0 -%}
{%- assign longest_recipe = site.recipes | first -%}
{%- assign most_ingredients = site.recipes | first -%}
{%- for recipe in site.recipes -%}
{%- assign steps_total = steps_total | plus: recipe.method.size -%}
{%- if recipe.method.size > longest_recipe.method.size -%}
{%- assign longest_recipe = recipe -%}
{%- endif -%}
{%- if recipe.ingredients.size > most_ingredients.ingredients.size -%}
{%- assign most_ingredients = recipe -%}
{%- endif -%}
{%- endfor -%}
{%- assign recipes_size_float = site.recipes.size | times: 1.0 -%}
< table >
< tr >
< td > Recipes< / td >
< td > {{ site.recipes.size }}< / td >
< / tr >
< tr >
< td > Subrecipes< / td >
< td > {{ site.subrecipes.size }}< / td >
< / tr >
< tr >
< td > Authors< / td >
< td > {{ site.recipes | map: "author" | uniq | size }}< / td >
< / tr >
< tr >
< td > Average recipe steps< / td >
< td > {{ steps_total | divided_by: recipes_size_float | round: 1 | replace: '.0', '' -}}< / td >
< / tr >
< tr >
< td > Most ingredients (excluding subrecipes)< / td >
< td > < a class = 'dark' href = '{{ most_ingredients.url }}' > {{ most_ingredients.name }}< / a > ({{ most_ingredients.ingredients.size }} ingredients)< / td >
< / tr >
< tr >
< td > Most steps (excluding subrecipes)< / td >
< td > < a class = 'dark' href = '{{ longest_recipe.url }}' > {{ longest_recipe.name }}< / a > ({{ longest_recipe.method.size }} steps)< / td >
< / tr >
< / table >
2020-03-06 13:20:21 +00:00
{%- else -%}
{%- comment -%} 0 recipes {%- endcomment -%}
< h2 > No recipes< / h2 >
< p >
No recipes found. Ensure that there is at least one recipe file in the < tt > _recipes< / tt > directory. See < a class = 'dark' href = '/help.html' > the help page< / a > for more information.
< / p >
2020-03-03 16:54:37 +00:00
{% endif %}