mirror of
https://github.com/kremalicious/blog.git
synced 2024-06-28 16:48:00 +02:00
31 lines
527 B
Plaintext
31 lines
527 B
Plaintext
---
|
|
import type { CollectionEntry } from 'astro:content'
|
|
import Picture from '@components/Picture/index.astro'
|
|
|
|
type Props = { post: CollectionEntry<'photos'> }
|
|
|
|
const { slug, data } = Astro.props.post
|
|
const { title, image } = data
|
|
---
|
|
|
|
<style>
|
|
.photo {
|
|
display: block;
|
|
}
|
|
</style>
|
|
|
|
{
|
|
image ? (
|
|
<a class="photo" href={`/${slug}/`}>
|
|
<Picture
|
|
width={202}
|
|
height={202}
|
|
src={image}
|
|
alt={`Photo for ${title}`}
|
|
title={title}
|
|
objectFit
|
|
/>
|
|
</a>
|
|
) : null
|
|
}
|