fix: sort bookmarks by date descending

This commit is contained in:
Lewis Wynne 2026-01-23 01:32:51 +00:00
parent a88af69ffd
commit 5553270e67

View file

@ -13,7 +13,8 @@ interface Bookmark {
const posts = await getCollection('posts');
const sorted = posts.sort((a, b) => b.data.date.getTime() - a.data.date.getTime());
const bookmarks = yaml.load(bookmarksRaw) as Bookmark[];
const bookmarks = (yaml.load(bookmarksRaw) as Bookmark[])
.sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime());
function formatDate(date: Date): string {
const d = String(date.getDate()).padStart(2, '0');