départ du tavernier
This commit is contained in:
@@ -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 || [])),
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user