Add detail page for album

This commit is contained in:
2025-11-22 15:18:57 +13:00
parent 7f0b65fa20
commit 20f8b38c8a
2 changed files with 38 additions and 7 deletions

View File

@@ -0,0 +1,29 @@
---
import Base from "@layout/Base";
import { authPB } from "@utils/pocketbase";
export const prerender = false
const { title } = Astro.params
const pb = await authPB()
const album = await pb.collection('albums').getFirstListItem(`title ~ "${decodeURI(title!)}"`)
const images = await Promise.all(
album.images.map(i => pb.files.getURL(album, i))
)
---
<Base>
<div slot="sidebar">
<h1>{album.title}</h1>
<p>{album.date}</p>
<p>{album.location}</p>
</div>
<div slot="content">
{
images.map(img => (
<img class="pb-2" src={img}/>
))
}
</div>
</Base>