shadowfacts.net/site/archive.html.ejs

24 lines
483 B
Plaintext
Raw Normal View History

2020-08-22 02:37:57 +00:00
```
metadata.layout = "default.html.ejs"
metadata.title = "Archive"
```
<div class="main">
<% let currentYear %>
<% for (const post of posts) { %>
<% if (post.metadata.date.getFullYear() !== currentYear) { %>
<% if (currentYear) { %>
</ul>
<% } %>
<% currentYear = post.metadata.date.getFullYear() %>
<h2><%= currentYear %></h2>
<ul>
<% } %>
<li>
<a href="<%= post.metadata.permalink %>">
<%= post.metadata.title %>
</a>
</li>
<% } %>
</div>