summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorJoe Carstairs <65492573+Sycamost@users.noreply.github.com>2023-08-20 18:45:33 +0100
committerJoe Carstairs <65492573+Sycamost@users.noreply.github.com>2023-08-20 18:45:33 +0100
commit6fc3866931b3d27cb77bf9b8a6119cb4c72e67c7 (patch)
treed3e365f4941cd0878e71162d84c9627575d995ff /src/components
parentbed472ede4cab85919c3887aa43766f2bffd732e (diff)
Sorts Scotsoun by ID descending
Diffstat (limited to 'src/components')
-rw-r--r--src/components/ScotsounCdGallery.astro7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/components/ScotsounCdGallery.astro b/src/components/ScotsounCdGallery.astro
index 0a8cd92..8ae2b22 100644
--- a/src/components/ScotsounCdGallery.astro
+++ b/src/components/ScotsounCdGallery.astro
@@ -1,9 +1,14 @@
---
import { getAllScotsoun } from '$data/scotsoun';
import getLocaleFromPath from '$lib/getLocaleFromPath';
+import type Scotsoun from '$types/Scotsoun';
const locale = getLocaleFromPath(Astro.url.pathname);
-const scotsoun = await getAllScotsoun();
+const scotsoun = (await getAllScotsoun()).sort(scotsounIdDescending);
+
+function scotsounIdDescending(scotsoun1: Scotsoun, scotsoun2: Scotsoun) {
+ return scotsoun2.scotsounId.localeCompare(scotsoun1.scotsounId);
+}
---
<ul class="link-gallery link-gallery--scotsoun">