{% extends "base.jinja2" %}

{% block content %}
<div>
    <div class="articles">

        <div class="h1">
            {{category.title}}
        </div>

        {% for page in all_pages.filter(primary_category=category.uuid)[:20] %}
            {% set has_image = page.image and page.image_host %}
            <div class="listing {% if not has_image %}no-pic{% endif %}">
                {% if has_image %}
                <a href="{{'page'|route_url(uuid=page.uuid)}}">
                    <img alt='{{page.title}}' src="{{page.image_host}}{{page.image|thumbor(45, 45)}}"/>
                </a>
                {% endif %}
                <div class="h2"><a href="{{'page'|route_url(uuid=page.uuid)}}">{{page.title}}</a></div>
                <p>{{page.description}}</p>
                <div class="clr"></div>
            </div>
        {% endfor %}
    </div>
</div>
{% endblock %}
