mirror of https://github.com/halo-dev/halo
perf: change the default sort order of articles (#2480)
#### What type of PR is this? /kind improvement /milestone 2.0 /area core #### What this PR does / why we need it: 修改文章列表的默认排序规则,之前是按照创建时间(createTime)升序,现在改为降序。即最新创建的文章在前面。 #### Special notes for your reviewer: 测试方式: 连续创建多篇文章,检查前后台的文章排序是否是最新的在最前面。 /cc @halo-dev/sig-halo #### Does this PR introduce a user-facing change? ```release-note None ```pull/2484/head
parent
91793a7e03
commit
e954af88ec
|
@ -73,7 +73,6 @@ public enum PostSorter {
|
||||||
Function<Post, Instant> createTime =
|
Function<Post, Instant> createTime =
|
||||||
post -> post.getMetadata().getCreationTimestamp();
|
post -> post.getMetadata().getCreationTimestamp();
|
||||||
return Comparator.comparing(createTime)
|
return Comparator.comparing(createTime)
|
||||||
.thenComparing(name)
|
.thenComparing(name);
|
||||||
.reversed();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue