Skip to content

Commit

Permalink
ローカルの画像をサムネイルに設定できるようにする
Browse files Browse the repository at this point in the history
  • Loading branch information
canoypa committed Sep 29, 2024
1 parent c6b1f34 commit 3b0275f
Showing 1 changed file with 24 additions and 21 deletions.
45 changes: 24 additions & 21 deletions src/features/post/thumbnail.astro
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,31 @@ const styles = {
---

<figure class:list={styles.root}>
<Image
src={image.src}
alt=""
width={image.width}
height={image.height}
class:list={styles.img}
/>

{
"attribution" in image && (
<figcaption>
<small class:list={styles.attribution}>
<span>Photo by </span>
<StyledLink href={image.attribution.authorUrl}>
{image.attribution.authorName}
</StyledLink>
<span> on </span>
<StyledLink href={image.attribution.siteUrl}>
{image.attribution.siteName}
</StyledLink>
</small>
</figcaption>
"attribution" in image ? (
<>
<Image
src={image.src}
alt=""
width={image.width}
height={image.height}
class:list={styles.img}
/>
<figcaption>
<small class:list={styles.attribution}>
<span>Photo by </span>
<StyledLink href={image.attribution.authorUrl}>
{image.attribution.authorName}
</StyledLink>
<span> on </span>
<StyledLink href={image.attribution.siteUrl}>
{image.attribution.siteName}
</StyledLink>
</small>
</figcaption>
</>
) : (
<Image src={image} alt="" class:list={styles.img} />
)
}
</figure>

0 comments on commit 3b0275f

Please sign in to comment.