summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoe Carstairs <65492573+Sycamost@users.noreply.github.com>2023-08-20 18:39:55 +0100
committerJoe Carstairs <65492573+Sycamost@users.noreply.github.com>2023-08-20 18:39:55 +0100
commitbed472ede4cab85919c3887aa43766f2bffd732e (patch)
tree5d8c254901b1cefa02244e26e84a1a130df18a64 /src
parentf62106c14559bbf541bacfca99dc29571d6c8066 (diff)
Sorts Lallans by issue number descending
Diffstat (limited to 'src')
-rw-r--r--src/components/LallansIssuesGallery.astro7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/components/LallansIssuesGallery.astro b/src/components/LallansIssuesGallery.astro
index f3db9b3..9ade033 100644
--- a/src/components/LallansIssuesGallery.astro
+++ b/src/components/LallansIssuesGallery.astro
@@ -1,9 +1,14 @@
---
import { getAllLallansIssues } from '$data/lallans';
import getLocaleFromPath from '$lib/getLocaleFromPath';
+import type LallansIssue from '$types/LallansIssue';
const locale = getLocaleFromPath(Astro.url.pathname);
-const issues = await getAllLallansIssues();
+const issues = (await getAllLallansIssues()).sort(issueNumberDescending);
+
+function issueNumberDescending(issue1: LallansIssue, issue2: LallansIssue) {
+ return issue2.issueNumber - issue1.issueNumber;
+}
---
<ul class="link-gallery link-gallery--lallans">