Files
nathanupchurch.com/_includes/postslist.njk
2026-06-28 20:18:03 -05:00

57 lines
2.0 KiB
Plaintext

<section class="postlist{% if postListTypeMicroblog %} microblogList{% endif %}">
{% if postlistHeaderText %}<h2 class="postlist-header">{{ postlistHeaderText }}</h2>{% endif %}
<div class="postlist-item-container">
{% for post in postslist %}
<article class="postlist-item{% if post.url == url %} postlist-item-active{% endif %}">
<div class="post-copy">
{% if not postListTypeMicroblog %}
<a href="{{ post.url }}" class="postlist-link">
{% endif %}
<h3>
{% if post.data.title %}{{ post.data.title | markdownify | safe }}{% else %}?{% endif %}
</h3>
{% if not postListTypeMicroblog %}
</a>
{% endif %}
{% if post.data.synopsis %}
<p>{{ post.data.synopsis | markdownify | safe }}</p>
{% endif %}
{% if not post.data.synopsis and post.data.description %}
<p>{{ post.data.description | markdownify | safe }}</p>
{% endif %}
<div class="post-metadata">
<div class="post-metadata-copy">
<p>
{% if not postListTypeMicroblog %}
{% if post.data.author %}
{% if post.data.author.url %}
<a href="{{ post.data.author.url }}">
{% endif %}
{% if post.data.author.name %}
{{ post.data.author.name }}
{% endif %}
{% if post.data.author.url %}</a>&nbsp;•&nbsp;
{% endif %}
{% else %}<a href="{{ metadata.author.url }}">{{ metadata.author.name }}</a>&nbsp;•&nbsp;
{% endif %}
{% endif %}
<time datetime="{{ post.date | htmlDateString }}">{{ post.date | niceDate }}{% if post.data.time %}—{{ post.data.time }}{% endif %}</time>
</p>
</div>
</div>
</div>
{% if not postListTypeMicroblog %}
<a href="{{ post.url }}" class="postlist-link">
<div class="post-image-container">
<img class="post-image" {% if post.data.imageURL %} src="{{ post.data.imageURL }}" alt="{{ post.data.imageAlt }}" {% else %} src="{{ metadata.defaultPostImageURL }}" alt="{{ metadata.defaultPostImageAlt }}"{% endif %}>
</div>
</a>
{% endif %}
</article>
<hr>
{% endfor %}
</div>
</section>