feat: add post category page

This commit is contained in:
XPoet 2020-09-02 17:49:53 +08:00
parent 4f6856db70
commit 9067e2893b
5 changed files with 96 additions and 2 deletions

View File

@ -16,8 +16,8 @@ menu:
Home: /
Archives: /archives
# Category: /category
# About: /about
# Links: /links
# About: /about
# ...
# RSS

14
layout/category-list.ejs Normal file
View File

@ -0,0 +1,14 @@
<div class="fade-in-down-animation">
<div class="category-list-container">
<div class="category-list-content">
<%- list_categories(site.categories, {
class: 'all-category'
}) %>
</div>
<div class="category-comments">
<% if (page.comments) { %>
<%- partial('_partial/comments/comment') %>
<% } %>
</div>
</div>
</div>

View File

@ -23,6 +23,9 @@
<% } else if (is_tag()) { %>
<%- partial('tag-content') %>
<% } else if (page.title == 'category') { %>
<%- partial('category-list') %>
<% } else if (page.title == 'about') { %>
<%- partial('about') %>
@ -62,4 +65,4 @@
</div>
<% if (theme.local_search.enable) { %>
<%- partial('_partial/local-search') %>
<% } %>
<% } %>

View File

@ -0,0 +1,76 @@
@require "./common/magic-theme.styl";
.category-list-container {
background: var(--background-color);
magic-container(1.005, 1.01, 30px);
+ils-tablet() {
magic-container(1.001, 1.005, 20px);
}
.category-list-content {
.all-category-list {
font-size: 1.18em;
+ils-tablet() {
font-size: 1.12em;
}
li.all-category-list-item {
margin-bottom: 15px;
&:last-child {
margin-bottom: 0;
}
a.all-category-list-link {
}
span.all-category-list-count {
float: right;
&::before {
content: '';
}
&::after {
content: '';
}
}
ul.all-category-list-child {
margin-left: 10px;
margin-top: 15px;
li {
&::before {
content: '· ';
}
margin-bottom: 10px;
&:last-child {
margin-bottom: 0;
}
}
}
}
}
}
}

View File

@ -12,6 +12,7 @@
@import "layout/_partial/footer.styl"
@import "layout/_partial/paginator.styl"
@import "layout/about.styl"
@import "layout/category-list.styl"
@import "layout/links.styl"
@import "layout/_partial/article-meta-info.styl"
@import "layout/home-content.styl"