Files
tabler/preview/pages/gallery.astro
T

30 lines
1.0 KiB
Plaintext

---
import DefaultLayout from '@shared/layouts/DefaultLayout.astro'
import GalleryPhoto from '@shared/components/cards/GalleryPhoto.astro'
import Pagination from '@ui/Pagination.astro'
import photos from '@data/photos.json'
import people from '@data/people.json'
import { requireIndex } from '@shared/lib/array'
import HeaderActionsPhotos from '@shared/components/layout/HeaderActionsPhotos.astro'
// Horizontal photos, limit 15; person = people[loop index].
const galleryPhotos = photos.filter((photo) => photo.horizontal).slice(0, 15)
---
<DefaultLayout title="Gallery" description="1-15 of 241 photos" pageMenu="extra.gallery">
<HeaderActionsPhotos slot="page-header-actions" />
<div class="row row-cards">
{
galleryPhotos.map((photo, index) => (
<div class="col-sm-6 col-lg-4">
<GalleryPhoto photo={photo} person={requireIndex(people, index)} index={index + 1} />
</div>
))
}
</div>
<div class="d-flex mt-5">
<Pagination class="ms-auto" />
</div>
</DefaultLayout>