Skip to content

Commit 2e66f2a

Browse files
dshkolclaude
andcommitted
Sort articles by release date instead of reference period
Articles are now sorted chronologically by when they were published, not by the data period they cover. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 6c461b8 commit 2e66f2a

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

docs/articles.json.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -234,14 +234,14 @@ const docsDir = path.dirname(new URL(import.meta.url).pathname);
234234
const enArticles = scanArticles(docsDir, "en");
235235
const frArticles = scanArticles(docsDir, "fr");
236236

237-
// Sort by reference period (data period) descending, fall back to release date
238-
function sortByReference(a, b) {
239-
const aKey = a.referenceDate || a.date || "0000-00";
240-
const bKey = b.referenceDate || b.date || "0000-00";
241-
return bKey.localeCompare(aKey);
237+
// Sort by release date descending (most recent first)
238+
function sortByDate(a, b) {
239+
const aDate = a.date || "0000-00-00";
240+
const bDate = b.date || "0000-00-00";
241+
return bDate.localeCompare(aDate);
242242
}
243-
enArticles.sort(sortByReference);
244-
frArticles.sort(sortByReference);
243+
enArticles.sort(sortByDate);
244+
frArticles.sort(sortByDate);
245245

246246
// Add prev/next navigation
247247
function addNavigation(articles) {

0 commit comments

Comments
 (0)