From 585e7eb3a6e9ace17c21b54996bfd271ebe1d8fc Mon Sep 17 00:00:00 2001 From: liding Date: Mon, 10 Jun 2024 12:43:46 +0800 Subject: [PATCH] Fix article sort problem in non-zh environment. --- src/components/article/CollectionSummary.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/article/CollectionSummary.astro b/src/components/article/CollectionSummary.astro index 1eba3a1..ce9be7f 100644 --- a/src/components/article/CollectionSummary.astro +++ b/src/components/article/CollectionSummary.astro @@ -36,7 +36,7 @@ const categoriedPostList: Array = allCategories.map((key) => { if (postA.data.lastUpdate !== postB.data.lastUpdate) { return postA.data.lastUpdate < postB.data.lastUpdate ? 1 : -1; } - return postA.id.localeCompare(postB.id); + return postA.id.localeCompare(postB.id, 'zh-Hans-CN', { sensitivity: 'accent' }); } ) : object[key].sort(