55 lines
No EOL
1.5 KiB
Text
55 lines
No EOL
1.5 KiB
Text
---
|
|
layout: base.njk
|
|
---
|
|
<article class="recipe">
|
|
<header class="recipe-header">
|
|
<h1>{{ title }}</h1>
|
|
{% if isDraft %}
|
|
<span class="draft-badge">Draft</span>
|
|
{% endif %}
|
|
<p class="recipe-version">Version {{ recipeVersion }}</p>
|
|
</header>
|
|
|
|
<div class="recipe-content">
|
|
{{ content | 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> |