Add Photo Album pages
This commit is contained in:
@@ -1,19 +1,23 @@
|
||||
---
|
||||
import { getAlbumRoute, getPhotoRoute } from '@/lib/routing';
|
||||
import { getPhotoRoute } from '@/lib/routing';
|
||||
import { AlbumPhotos } from './Album.tsx';
|
||||
import { getImageSize, getImageUrl } from '@/lib/images';
|
||||
import { getSettings } from '@/content/settings/settings';
|
||||
|
||||
interface Props {
|
||||
album: PhotoAlbum;
|
||||
page: PhotoAlbumPage;
|
||||
}
|
||||
|
||||
const settings = await getSettings();
|
||||
const album = Astro.props.album;
|
||||
const album = Astro.props.page;
|
||||
const pageNumber = Astro.props.page.pageNumber;
|
||||
|
||||
const startNumber = (pageNumber - 1) * settings.photo.album.perPage;
|
||||
const endNumber = pageNumber * settings.photo.album.perPage;
|
||||
|
||||
const remappedPhotos: PhotoAlbumGalleryItem[] = [];
|
||||
|
||||
album.photos.forEach((photo) => {
|
||||
album.photos.slice(startNumber, endNumber).forEach((photo) => {
|
||||
const resizedImage = getImageSize(photo.photo.width, photo.photo.height, 0.67);
|
||||
|
||||
remappedPhotos.push({
|
||||
|
||||
Reference in New Issue
Block a user