hexo-theme-stellar/layout/categories.ejs

24 lines
774 B
Plaintext
Executable File

<%
if (page.class == undefined) {
page.class = 'post';
}
%>
<% if (site.categories.length) { %>
<% page.title = __('btn.categories'); %>
<% page.layout = 'categories'; %>
<%- partial('_partial/navbar/list_post') %>
<div class='post-list'>
<div class='list-title'><%- __('page.categories', site.categories.length) %></div>
<article class='post-card reveal' id='cats'>
<% site.categories.sort('path').each(function(category){ %>
<div>
<a class="<%= category.parent ? 'cat child' : 'cat'%>" href="<%= url_for(category.path) %>">
<span class='name'><%- category.name %></span>
<span class='badge'>(<%- category.posts.length %>)</span>
</a>
</div>
<% }) %>
</article>
</div>
<% } %>