Skip to content

Commit 4efdffc

Browse files
committed
feat: display image
1 parent e1b849b commit 4efdffc

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/components/NewsletterLayout.astro

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
import Layout from './Layout.astro';
3+
import { Image } from '@astrojs/image/components';
34
45
import type { MarkdownLayoutProps } from 'astro';
56
@@ -16,9 +17,16 @@ const { frontmatter, headings } = Astro.props;
1617

1718
<Layout title={frontmatter.title}>
1819
<div class="mx-auto max-w-2xl">
19-
<div class="pb-4">
20+
<div class="pb-8">
2021
<h1 class="text-2xl font-bold">{frontmatter.title}</h1>
2122
<p class="text-gray-500">{frontmatter.date}</p>
23+
<Image
24+
class="rounded-lg w-full my-4"
25+
src={`/assets/newsletter/${frontmatter.date}.png`}
26+
alt={frontmatter.title}
27+
width={512}
28+
height={288}
29+
/>
2230
<p>{frontmatter.description}</p>
2331
<div>
2432
<h2 class="text-lg font-semibold">Table of Contents</h2>

0 commit comments

Comments
 (0)