summaryrefslogtreecommitdiff
path: root/themes/theme/layout/partials/post_list.ejs
blob: df3e8f2e87f47420936bb11850d20ed86a262eac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<div class="post-list">
    <% var last_year = ''; %>
    <% page.posts.each(function (post) { %>

        <% var cur_year = post.date.year(); %>

        <% if(last_year !== cur_year){ %>
            <div class="year-title"><%- cur_year %></div>
        <% last_year = cur_year; } %>

        <div class="post-list-item">
            <div class="post-title">
            <a href="<%- url_for(post.path) %>">
                <% if (post.title) {%>
                    <%= post.title %>
                <% } else {%>
                    *Untitled
                <% } %>
                </a> 
            </div>
            
            <span class="post-date"><%- date(post.date, theme.date_format) %></span>
        </div>

    <% }) %>
    <div id="paginator">
        <%- partial('partials/paginator') %>
    </div>
</div>