From 582051ba2094aeb7b6ffe497df075439aaf5ebbf Mon Sep 17 00:00:00 2001 From: June Date: Sat, 22 Nov 2025 17:53:09 +1300 Subject: [PATCH] Add recent albums section at index --- web/src/components/index/recentAlbums.astro | 36 +++++++++++++++++++++ web/src/pages/index.astro | 11 +++---- 2 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 web/src/components/index/recentAlbums.astro diff --git a/web/src/components/index/recentAlbums.astro b/web/src/components/index/recentAlbums.astro new file mode 100644 index 0000000..f94609f --- /dev/null +++ b/web/src/components/index/recentAlbums.astro @@ -0,0 +1,36 @@ +--- +import SummaryCard from "./summaryCard.astro"; +import { authPB } from "@utils/pocketbase"; +import { getFormattedDate } from "@utils/date"; + +const pb = await authPB() + +const albums = await pb.collection('albums').getList(1, 3, { + sort: '-created', +}) + +const postImages = await Promise.all( albums.items.map(a => pb.files.getURL(a, a.images[0])) ) + +--- + +
+ { + albums.items.map((p, i) => ( + + )) + } +
+
\ No newline at end of file diff --git a/web/src/pages/index.astro b/web/src/pages/index.astro index 371aabd..dae29e1 100644 --- a/web/src/pages/index.astro +++ b/web/src/pages/index.astro @@ -1,6 +1,7 @@ --- import Base from "src/layout/Base.astro" import RecentPosts from "@components/index/recentPosts" +import RecentAlbums from "@components/index/recentAlbums" export const prerender = false @@ -12,15 +13,13 @@ export const prerender = false

This is the third major iteration of the website, and by far the most flexible and best designed (imo!)


- - - -

I'm... really not sure what to put on this landing page, make sure to check out some of the photos and posts I've added recently, I've been totally revamping those too and I'm really proud of this batch.


+

I'm... really not sure what else to put on this landing page, make sure to check out some of the photos and posts I've added recently, I've been totally revamping those too and I'm really proud of this batch.


Hope you enjoy your time here :)

- +