Skip to content

Commit

Permalink
✨ feat: 分类页支持显示更少文章信息
Browse files Browse the repository at this point in the history
  • Loading branch information
白云苍狗 committed Sep 23, 2022
1 parent 60b2336 commit 97d5c97
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 17 deletions.
4 changes: 4 additions & 0 deletions package/hexo-theme-async/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ footer:
#
custom_text:

# archive
archive:
type: more # less more

# Reward (Donate)
# If enable true, reward would be displayed in every posts and pages by default.
# You can show or hide reward in a specific page throuth `reward: true | false` in Front Matter.
Expand Down
44 changes: 27 additions & 17 deletions package/hexo-theme-async/layout/_partial/page/archive.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -42,30 +42,40 @@
<div class="trm-timeline-item trm-scroll-animation" data-scroll data-scroll-offset="40">
<div class="trm-timeline-mark-light"></div>
<div class="trm-timeline-mark"></div>
<div class="trm-a trm-timeline-content">
<div class="trm-card-header">
<div class="trm-left-side">
<div class="trm-a trm-timeline-content <%- theme.archive.type %>">
<% if(theme.archive.type === 'less'){ %>
<div class="trm-card-header">
<h6>
<a href="<%- url_for(element.path) %>" class="trm-anima-link">
<%= element.title %>
</a>
</h6>
<div class="trm-text-sm trm-accent-color trm-mt-15">
<ul class="trm-card-data trm-label ">
<li class="trm-accent-color"><%= date(element.date,'MM/DD') %></li>
<li class="trm-accent-color"><%= date(element.date,'hh:mm') %></li>
<% if(theme.wordcount.enable && theme.wordcount.count){ %>
<li><%= wordcount(element.content) %></li>
<% } %>
</ul>
</div>
</div>
</div>
<%if(element.excerpt){%>
<div class="trm-publication trm-mt-15">
<%- element.excerpt %>
<% } else {%>
<div class="trm-card-header">
<div class="trm-left-side">
<h6>
<a href="<%- url_for(element.path) %>" class="trm-anima-link">
<%= element.title %>
</a>
</h6>
<div class="trm-text-sm trm-accent-color trm-mt-15">
<ul class="trm-card-data trm-label ">
<li class="trm-accent-color"><%= date(element.date,'MM/DD') %></li>
<li class="trm-accent-color"><%= date(element.date,'hh:mm') %></li>
<% if(theme.wordcount.enable && theme.wordcount.count){ %>
<li><%= wordcount(element.content) %></li>
<% } %>
</ul>
</div>
</div>
</div>
<%}%>
<%if(element.excerpt){%>
<div class="trm-publication trm-mt-15">
<%- element.excerpt %>
</div>
<%}%>
<% } %>
</div>
</div>
<% }) %>
Expand Down
5 changes: 5 additions & 0 deletions package/hexo-theme-async/source/css/_components/timeline.less
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,10 @@
margin-bottom: 0;
}
}

&.less {
padding : 20px 30px;
margin-bottom: 20px;
}
}
}

0 comments on commit 97d5c97

Please sign in to comment.