diff --git a/_layouts/recipe.html b/_layouts/recipe.html index 756c2a2..7c8addd 100644 --- a/_layouts/recipe.html +++ b/_layouts/recipe.html @@ -14,7 +14,21 @@ layout: default {%- endfor -%}

{{ page.name }}

-

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

+{%- if page.time -%} + {%- if page.time > 59 %} + {%- assign hours = page.time | divided_by: 60 -%} + {%- assign minutes = page.time | modulo: 60 -%} + {%- assign time = hours | append: " hour" -%} + {%- if hours > 1 %}{% assign time = time | append: "s" %}{% endif -%} + {%- if minutes > 0 -%} + {%- assign time = time | append: " " | append: minutes | append: " minute" -%} + {%- if minutes > 1 %}{% assign time = time | append: "s" %}{% endif -%} + {%- endif -%} + {%- else -%} + {%- assign time = page.time %} + {%- endif -%} +{%- 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 -%}