Add initial README.md for Astro Starter Kit: Minimal
This commit is contained in:
14
src/components/HomeGallery.astro
Normal file
14
src/components/HomeGallery.astro
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
const gallery = await Astro.glob('../../content/gallery/gallery-sample.md');
|
||||
const images = gallery[0]?.frontmatter.images || [];
|
||||
---
|
||||
<section class="max-w-6xl mx-auto my-20">
|
||||
<h2 class="text-2xl font-headline font-bold mb-6 text-primary text-center">Gallery</h2>
|
||||
<div class="grid grid-cols-2 md:grid-cols-4 gap-4">
|
||||
{images.map((img, idx) => (
|
||||
<div class="rounded-lg overflow-hidden shadow-md bg-base-100" key={idx}>
|
||||
<img src={img} alt={`Gallery photo ${idx + 1}`} class="w-full h-40 object-cover hover:scale-105 transition-transform duration-200 cursor-pointer" />
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
Reference in New Issue
Block a user