74 lines
No EOL
2.3 KiB
Text
74 lines
No EOL
2.3 KiB
Text
---
|
|
layout: base.njk
|
|
pageType: recipe
|
|
---
|
|
<article class="recipe">
|
|
{% if isDraft %}
|
|
<div class="warning-banner">
|
|
⚠️ This recipe is still a draft and may be incomplete or subject to changes.
|
|
</div>
|
|
{% endif %}
|
|
{% if plantBased === false %}
|
|
<div class="warning-banner">
|
|
This recipe contains products of animal agriculture. Animal agriculture is a significant contributor to greenhouse gas emissions, deforestation, water pollution, and worker exploitation. Consider exploring plant-based alternatives to reduce negative impacts.
|
|
</div>
|
|
{% endif %}
|
|
<header class="recipe-header">
|
|
<h1>{{ title }}</h1>
|
|
{% if isDraft %}
|
|
<span class="draft-badge">Draft</span>
|
|
{% endif %}
|
|
<p class="recipe-version">Version {{ recipeVersion }}</p>
|
|
{% if amount %}
|
|
<p class="recipe-amount">Amount: {{ amount }}</p>
|
|
{% endif %}
|
|
{% if cookingTime %}
|
|
<p class="recipe-cooking-time">Cooking Time: {{ cookingTime }}</p>
|
|
{% endif %}
|
|
</header>
|
|
|
|
<div class="measurement-toggles" style="display: none;"></div>
|
|
|
|
<div class="recipe-content">
|
|
{{ content | renderRecipeMarkdown | safe }}
|
|
</div>
|
|
|
|
{% set recipeTags = page.inputPath | extractTagsFromFile %}
|
|
|
|
{% if recipeTags.length > 0 %}
|
|
<section class="recipe-tags">
|
|
<h2>Tags</h2>
|
|
<ul class="tag-list">
|
|
{% for tag in recipeTags %}
|
|
<li><a href="/tags/{{ tag | lower }}/">#{{ tag }}</a></li>
|
|
{% endfor %}
|
|
</ul>
|
|
</section>
|
|
{% endif %}
|
|
|
|
{% if not isDraft and isNewestVersion %}
|
|
<p class="recipe-permalink">
|
|
Permalink: <a href="/recipe/{{ recipeSlug }}/">/recipe/{{ recipeSlug }}/</a>
|
|
</p>
|
|
{% endif %}
|
|
|
|
{% set recipeData = collections.recipesBySlug[recipeSlug] %}
|
|
{% set nonDraftVersions = [] %}
|
|
{% for version in recipeData.versions %}
|
|
{% if not version.data.isDraft %}
|
|
{% set nonDraftVersions = (nonDraftVersions.push(version), nonDraftVersions) %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
{% if nonDraftVersions.length > 1 %}
|
|
<aside class="recipe-other-versions">
|
|
<p>Other versions:
|
|
{% for version in nonDraftVersions %}
|
|
{% if version.url != page.url %}
|
|
<a href="{{ version.url }}">v{{ version.data.recipeVersion }}</a>{% if not loop.last %}, {% endif %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
</p>
|
|
</aside>
|
|
{% endif %}
|
|
</article> |