{% extends "base.html" %}
{% block content %}
<article class="post panel">
<h1 class="post-title">{{ section.title }}</h1>
{{ section.content | safe }}
<div class="project-cards">
{% for path in section.subsections %}
<div class="project-card">
{% set sect = get_section(path=path) %}
<a href="{{ sect.permalink }}">
<h2>{{ sect.title }}</h2>
{% if sect.extra.image is defined %}
{% set image = resize_image(path=sect.extra.image, width=640, height=480, op="fit") %}
<img src="{{ image.url }}" />
{% else %}
<img src="//picsum.photos/seed/{{ path | slugify }}/320/240" />
{% endif %}
<p>{{ sect.description }}</p>
</a>
</div>
{% endfor %}
{% for page in section.pages %}
<div class="project-card">
<a href="{{ page.permalink }}">
<h2>{{ page.title }}</h2>
{% if page.extra.image is defined %}
{% set image = resize_image(path=page.extra.image, width=640, height=480, op="fit") %}
<img src="{{ image.url }}" />
{% else %}
<img src="//picsum.photos/seed/{{ page.path | slugify }}/320/240" />
{% endif %}
<p>{{ page.description }}</p>
</a>
</div>
{% endfor %}
</div>
</article>
{% endblock %}
