---
layout: "layouts/base.liquid"
title: "Posts"
eleventyNavigation:
    key: Posts
---

<div style="margin-block:2rem;">
    <h1>Posts</h1>
    <div class="post-list">
    {% if collections.posts and collections.posts.size > 0 %}
        {% for post in collections.posts reversed %}
        <article>
            <h2><a href="{{ post.url }}">{{ post.data.title }}</a></h2>

            {% if post.data.featuredImage %}
            <img src={{ post.data.featuredImage }} alt={{ post.data.featuredImageAlt }}>
            {% endif %}

            <div class="date-and-tags">
                {% if post.data.date %}
                <p class="date">{{ post.date | date: "%B %d, %Y" }}</p>
                {% endif %}


                {% assign filteredTags = post.data.tags | where_exp: "tag", "tag != 'posts'" %}
                {% if filteredTags.size > 0 %}
                    <div class="tags">
                        <span>—</span>
                        <ul>
                            {% for tag in filteredTags %}
                            <li>{{ tag }}</li>
                            {% endfor %}
                        </ul>
                    </div>            
                {% endif %}
            </div>

            <p>{{ post.data.description | default: "" }}</p>
        </article>
        {% endfor %}
    {% else %}
        <p>No posts yet...</p>
    {% endif %}
    </div>
</div>