{% extends "base.jinja" %}
{% from 'snippets/inventory.jinja'  import inventory with context %}

{% block content %}



<article>
<header>
    <h1>{{page['title']}}</h1>

    {% if page['start_datetime'] %}
        <h4 class="date">{{ page['start_datetime'] | prettydate }} </h4>
    {% endif %}
</header>


    {% if page['image'] %}
        <img src="{{ page['image'] }}" alt="" />
    {% endif %}

    {% if page['schematic'] %}
        <img src="{{ page['schematic'] }}" alt="" />
    {% endif %}

     {% if page['media'] %}
        <img src="https://calendar.klank.school/media/thumb/{{ page['media'][0]['url'] }}" alt="" />
    {% endif %}

    {% if page.pdf %}
    <p class="no-print">
        <i>Download this chapter as a <a href="{{ page.pdf }}">PDF</a></i>
    </p>
    {% endif %} 

    {{ page['body'] | shortcode }}

    {% if page.folder == "devices" %}
        <h2>Parts salvaged from this device</h2>
        {{ inventory("Where", ( page.title.capitalize() | slugify )) }}
    {%  endif %}

    {% if page.folder == "components" %}

        {{inventory("type", (page.type.capitalize()  | slugify)) }}
    {%  endif %}
</article>
{% endblock %} {% block aside %} {% endblock %}
