--- import { Image } from 'astro:assets' // Import all JPG images from the assets/images folder const images = import.meta.glob('@/assets/images/*.jpg', { eager: true }) const imageList = Object.entries(images).map(([path, module]) => { const imageModule = module as { default: ImageMetadata } const fileName = path.split('/').pop() || 'unknown' return { src: imageModule.default, name: fileName.replace('.jpg', '').replace('_cropped', ''), } }) --- Meme AulaStud
{ imageList.map((image, index) => { // Calculate the height span based on image aspect ratio // Assuming 250px base width (from minmax), calculate proportional height const aspectRatio = image.src.width / image.src.height const baseWidth = 300 const calculatedHeight = Math.ceil(baseWidth / aspectRatio + 2) // +2 for gap return (
{image.name}
) }) }