Skip to content

Commit 7b23047

Browse files
authored
Merge pull request #40 from f-dong/BUG修复
[BUG]文章置顶不起作用
2 parents d1220b2 + 9061fa4 commit 7b23047

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hexo-theme-minimalism",
3-
"version": "1.3.10",
3+
"version": "1.3.11",
44
"private": false,
55
"description": "a minimalist Hexo theme that is simple yet elegant, enabling your blog content to shine. Its powerful features also help you create a personalized blog that truly stands out.",
66
"scripts": {

scripts/filters/post-hide.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ hexo.extend.generator.register('index', locals => {
5959
const { index_generator } = hexo.config;
6060
locals.posts = locals.posts.sort(index_generator.order_by || '-date');
6161

62+
locals.posts.data.sort((a, b) => (b.sticky || 0) - (a.sticky || 0));
63+
6264
if (index_generator.per_page > 0) {
6365
const pagination = require('hexo-pagination');
6466
return pagination(index_generator.path || '', locals.posts, {

0 commit comments

Comments
 (0)