Skip to content

Commit

Permalink
修复lodsh版本不同导致的方法调用错误
Browse files Browse the repository at this point in the history
  • Loading branch information
yscoder committed Jun 27, 2016
1 parent b58192b commit 3b294a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions layout/archive.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
page.posts.each(function(post){
posts.push(post);
});
var sortPosts = _.orderBy(posts, ['date'], ['desc']);
var sortPosts = _[_.orderBy ? 'orderBy' : 'sortByOrder'](posts, ['date'], ['desc']);
%>

<%
<%
var y = 0, m = 0;
sortPosts.forEach(function(post, i){
sortPosts.forEach(function(post, i){
var dt = post.date;
var ny = post.date.year();
var nm = post.date.month();
if(ny !== y || nm !== m) {
if(ny !== y || nm !== m) {
y = ny;
m = nm;
Expand All @@ -22,7 +23,7 @@
<% } %>
<%- partial('_partial/archive', {post: post}) %>
<%- partial('_partial/archive', {post: post}) %>
<%})%>

<% if (page.total > 1){ %>
Expand All @@ -34,4 +35,4 @@
}) %>
</div>
</nav>
<% } %>
<% } %>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "hexo-theme-material-indigo",
"version": "0.4.1",
"version": "0.4.2",
"private": true
}

0 comments on commit 3b294a0

Please sign in to comment.