hexo-theme-stellar/layout/categories.ejs

24 lines
733 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'>
2021-11-06 16:00:03 +08:00
<article class='<%- scrollreveal() %>' id='cats'>
2021-02-19 23:33:19 +08:00
<% site.categories.sort('path').each(function(category){ %>
<div>
2021-07-09 23:02:13 +08:00
<a class="<%= category.parent ? 'cat child' : 'cat'%>" href="<%= url_for(category.path) %>">
2021-02-19 23:33:19 +08:00
<span class='name'><%- category.name %></span>
<span class='badge'>(<%- category.posts.length %>)</span>
</a>
</div>
<% }) %>
</article>
</div>
<% } %>