départ du tavernier

This commit is contained in:
2026-03-08 12:53:38 +04:00
parent ea13013750
commit c2ec6c5104

View File

@@ -14,9 +14,17 @@ const eras = allPosts
.map((p) => ({ id: p.id, title: p.data.title })); .map((p) => ({ id: p.id, title: p.data.title }));
const chroniclesOnly = allPosts.filter((post) => !post.data.isEra); const chroniclesOnly = allPosts.filter((post) => !post.data.isEra);
const sortedPosts = chroniclesOnly.sort( const sortedPosts = chroniclesOnly.sort((a, b) => {
(a, b) => b.data.publishDate.valueOf() - a.data.publishDate.valueOf(), const dateDiff =
); b.data.publishDate.valueOf() - a.data.publishDate.valueOf();
// Si les dates sont identiques, on trie par titre (001, 002, etc.)
if (dateDiff === 0) {
return a.data.title.localeCompare(b.data.title);
}
return dateDiff;
});
const allTags = [ const allTags = [
...new Set(chroniclesOnly.flatMap((post) => post.data.tags || [])), ...new Set(chroniclesOnly.flatMap((post) => post.data.tags || [])),
]; ];