Skip to content

Commit c82ac37

Browse files
committed
randomly sort photos
1 parent 072dad6 commit c82ac37

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/pages/photos.astro

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ try {
2828
.filter((obj: any) => obj.Key?.match(/\.(jpg|jpeg|png|gif|webp)$/i))
2929
.filter((obj: any) => !obj.Key?.startsWith("preview_"));
3030
31-
const sortedPhotos = filteredPhotos.sort((a: any, b: any) => {
32-
return b.Key!.localeCompare(a.Key!);
33-
});
31+
const sortedPhotos = filteredPhotos.sort(() => Math.random() - 0.5);
3432
3533
photos = sortedPhotos.map((obj: any) => obj.Key!);
3634
}

0 commit comments

Comments
 (0)