Skip to content

Commit bc293c2

Browse files
authored
sort same date posts by path (#1940)
1 parent a415d8d commit bc293c2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.vuepress/components/BlogPosts.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ export default {
2929
let path = p.path.replace('/blog/', '');
3030
return { ...p, path: path, date: path.substring(0, 10) };
3131
})
32-
.sort((a, b) => new Date(b.date) - new Date(a.date));
32+
.sort(
33+
(a, b) =>
34+
new Date(b.date) - new Date(a.date) || b.path.localeCompare(a.path),
35+
);
3336
},
3437
},
3538
};

0 commit comments

Comments
 (0)