We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 63fe796 commit b9ef735Copy full SHA for b9ef735
1 file changed
src/pages/archives/index.astro
@@ -59,9 +59,19 @@ const MonthMap: Record<string, string> = {
59
<sup class="text-xs">{monthGroup.length}</sup>
60
</div>
61
<ul>
62
- {monthGroup.map(({ data, slug }) => (
63
- <Card href={`/posts/${slug}`} frontmatter={data} />
64
- ))}
+ {monthGroup
+ .sort(
+ (a, b) =>
65
+ Math.floor(
66
+ new Date(b.data.pubDatetime).getTime() / 1000
67
+ ) -
68
69
+ new Date(a.data.pubDatetime).getTime() / 1000
70
+ )
71
72
+ .map(({ data, slug }) => (
73
+ <Card href={`/posts/${slug}`} frontmatter={data} />
74
+ ))}
75
</ul>
76
77
))}
0 commit comments