diff options
Diffstat (limited to 'themes/theme/layout/partials/post_list.ejs')
| -rw-r--r-- | themes/theme/layout/partials/post_list.ejs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/themes/theme/layout/partials/post_list.ejs b/themes/theme/layout/partials/post_list.ejs new file mode 100644 index 00000000..df3e8f2e --- /dev/null +++ b/themes/theme/layout/partials/post_list.ejs @@ -0,0 +1,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> |
