--- import BaseLayout from "@/layouts/BaseLayout.astro" import SiteHeader from "@/components/site-header.astro" import Footer from "@/components/footer.astro" import { siteTitleSuffix } from "@/data/site" import { galleryConfig } from "@/data/gallery" import { getAlbumCover, scanAlbumPhotos } from "@/lib/gallery" export function getStaticPaths() { return galleryConfig.albums.map((album) => ({ params: { album: album.id } })) } const albumId = Astro.params.album as string const album = galleryConfig.albums.find((a) => a.id === albumId) if (!album) { return Astro.redirect("/404/") } const photos = scanAlbumPhotos(album.id) const cover = getAlbumCover(album, photos) const columnWidth = galleryConfig.columnWidth || 240 const title = `${album.name} | ${siteTitleSuffix}` const description = album.description ?? "相册" ---
{/* 封面横幅 */}
{cover ? (
{album.name}
← 返回相册

{album.name}

{album.description && (

{album.description}

)}
{album.date && 🗓 {album.date}} {album.location && 📍 {album.location}} 🖼 {photos.length} 张
{album.tags && album.tags.length > 0 && (
{album.tags.map((tag) => ( {tag} ))}
)}
) : (
← 返回相册

{album.name}

)}
{/* 瀑布流 */}
{photos.length > 0 ? ( ) : (
这个相册还没有照片。往 public/gallery/{album.id}/ 里放图片即可。
)}