Skip to content

Commit 0237656

Browse files
nikoshellegeakman
andauthored
Sprints update (#1458)
No headlines in sprints description. Add sprints alphabetical sorting. --------- Co-authored-by: Ege Akman <[email protected]>
1 parent 2a47562 commit 0237656

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/components/SprintCard.astro

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ if (!sprint) {
1111
throw new Error(`Sprint entry "${slug}" not found`);
1212
}
1313
14+
if (sprint.body && /^#+\s/m.test(sprint.body)) {
15+
throw new Error(`No headlines allowed in description. [${sprint.id}]`);
16+
}
17+
18+
1419
const { data, body } = sprint;
1520
1621
// <a href={`/sprints/${slug}`} id={slug} class="text-blue-600 hover:text-blue-800 hover:underline"></a>

src/pages/sprints.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ if (!entry) {
1616
throw new Error('Could not find page entry.');
1717
}
1818
19-
const sprints = await getCollection("sprints", ({ data }) => {
19+
const sprints = (await getCollection("sprints", ({ data }) => {
2020
return import.meta.env.MODE === "production" ? data.draft !== true : true;
21-
});
21+
})).sort((a, b) => a.id.localeCompare(b.id));
2222
2323
---
2424

0 commit comments

Comments
 (0)