--- import BaseLayout from "@/layouts/BaseLayout.astro" import SiteHeader from "@/components/site-header.astro" import { Footer } from "@/components/footer" import { siteTitleSuffix } from "@/data/site" import { getAllAlbumTags, getAlbums } from "@/lib/gallery" const title = `相册 | ${siteTitleSuffix}` const description = "按相册整理的照片" const albums = getAlbums() const allTags = getAllAlbumTags(albums) --- {/* 页头 */} 相册 共 {albums.length} 个相册,{albums.reduce((n, a) => n + a.photoCount, 0)} 张照片。 {/* 标签筛选 */} { allTags.length > 0 && ( 全部 {allTags.map((tag) => ( {tag} ))} ) } {/* 相册网格 */} { albums.length > 0 ? ( {albums.map((album) => ( {album.cover ? ( ) : ( 📷 )} {album.photoCount} 张 {album.name} {album.description && ( {album.description} )} {album.date && {album.date}} {album.location && 📍 {album.location}} {album.tags && album.tags.length > 0 && ( {album.tags.slice(0, 4).map((tag) => ( {tag} ))} )} ))} ) : ( 还没有相册 ) }
共 {albums.length} 个相册,{albums.reduce((n, a) => n + a.photoCount, 0)} 张照片。
{album.description}