Skip to content

Commit

Permalink
Fix random crash with collection load order (#5688)
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheeguerin authored Jan 22, 2025
1 parent 06bc35c commit 0d157d4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions website/src/components/release-notification.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
import { getCollection } from "astro:content";
const releaseNotes = await getCollection("docs", (x) => x.id.startsWith("docs/release-notes"));
releaseNotes.sort((a, b) => a.id.localeCompare(b.id));
const last = releaseNotes[releaseNotes.length - 1];
const releaseDate = last.data.releaseDate;
if (!releaseDate) {
Expand All @@ -10,6 +11,8 @@ if (!releaseDate) {
`Last release notes(${last.id}) should have a releaseDate: property in frontmatter. For example:`,
` releaseDate: ${today.getFullYear()}-${today.getMonth() + 1}-${today.getDate()}`,
"",
"Loaded release notes:",
...releaseNotes.map((x) => ` - ${x.id}`),
].join("\n"),
);
}
Expand Down

0 comments on commit 0d157d4

Please sign in to comment.