--- layout: default custom_h1: true --- {%- comment -%} return everything before the first full stop, without the trailing "_recipes/". for example: "_recipes/file.yml.md" becomes "file" {%- endcomment -%} {%- assign id = page.path | split: "." | pop | first | remove_first: "_recipes/" -%} {%- comment -%} unfortunately we have to iterate through the entire subrecipe folder twice - once to see if there are any subrecipes that apply here, and another time to put them in. thankfully we can break out of the first loop if we find a single match. i miss jinja ;u; {%- endcomment -%} {%- assign applicable_subrecipes = false -%} {%- for subrecipe in site.subrecipes -%} {%- if subrecipe.parents contains id -%} {%- comment -%} we found one! {%- endcomment -%} {%- assign applicable_subrecipes = true -%} {%- break -%} {%- endif -%} {%- endfor -%}

{{ page.name }}

{{ page.name }}

{%- if page.time -%} {%- assign time = page.time | hours_and_minutes -%} {%- endif -%}

{% if page.difficulty %}Difficulty: {{ page.difficulty | to_stars }} - {% endif %}{{ page.method.size }} steps - Estimated cooking time: {{ time | default: "Not provided" }} {% if page.author %} - By {{ page.author }} {% endif %}

{%- if applicable_subrecipes %}

Subrecipes

{% for subrecipe in site.subrecipes -%} {%- if subrecipe.parents contains id -%} {%- assign srid = "sr-" | append: subrecipe.name | downcase | url_encode -%}

{{ subrecipe.name }}

{{ subrecipe.output }}
{%- endif -%} {%- endfor -%} {%- endif -%} {%- include ingredients.html -%} {%- include method.html -%}