]> git.drewedgar.com - website.git/blob - src/posts.liquid
CHORE: Added eleventy to npm package cache
[website.git] / src / posts.liquid
1 ---
2 layout: "layouts/base.liquid"
3 title: "Posts"
4 eleventyNavigation:
5     key: Posts
6 ---
7
8 <div style="margin-block:2rem;">
9     <h1>Posts</h1>
10     <div class="post-list">
11     {% if collections.posts and collections.posts.size > 0 %}
12         {% for post in collections.posts reversed %}
13         <article>
14             <h2><a href="{{ post.url }}">{{ post.data.title }}</a></h2>
15
16             {% if post.data.featuredImage %}
17             <img src={{ post.data.featuredImage }} alt={{ post.data.featuredImageAlt }}>
18             {% endif %}
19
20             <div class="date-and-tags">
21                 {% if post.data.date %}
22                 <p class="date">{{ post.date | date: "%B %d, %Y" }}</p>
23                 {% endif %}
24
25
26                 {% assign filteredTags = post.data.tags | where_exp: "tag", "tag != 'posts'" %}
27                 {% if filteredTags.size > 0 %}
28                     <div class="tags">
29                         <span>—</span>
30                         <ul>
31                             {% for tag in filteredTags %}
32                             <li>{{ tag }}</li>
33                             {% endfor %}
34                         </ul>
35                     </div>            
36                 {% endif %}
37             </div>
38
39             <p>{{ post.data.description | default: "" }}</p>
40         </article>
41         {% endfor %}
42     {% else %}
43         <p>No posts yet...</p>
44     {% endif %}
45     </div>
46 </div>