hexo-theme-stellar/layout/categories.ejs

25 lines
829 B
Plaintext
Raw Normal View History

2021-02-19 23:33:19 +08:00
<%
2021-02-21 13:44:11 +08:00
page.robots = 'noindex,follow';
2021-02-21 03:13:21 +08:00
if (page.menu_id == undefined) {
page.menu_id = 'post';
2021-02-19 23:33:19 +08:00
}
%>
<% if (site.categories.length) { %>
<% page.title = __('btn.categories'); %>
<% page.layout = 'categories'; %>
2021-02-20 13:09:41 +08:00
<%- partial('_partial/main/navbar/list_post') %>
2021-02-19 23:33:19 +08:00
<div class='post-list'>
<div class='list-title'><%- __('page.categories', site.categories.length) %></div>
2021-02-22 13:19:21 +08:00
<article class='post-card<%- scrollreveal() %>' id='cats'>
2021-02-19 23:33:19 +08:00
<% 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>
<% } %>