Skip to content

Commit

Permalink
make gallery accept a prop for images
Browse files Browse the repository at this point in the history
  • Loading branch information
sandroid committed Nov 29, 2023
1 parent 80fe43f commit 1c1c80a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
26 changes: 19 additions & 7 deletions src/components/ImageComponent/ShittyGallery.astro
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
---
import MyCustomImageComponent from "./MyCustomImageComponent.astro";
import { Image } from "astro:assets";
import ImageWrapper from "../react/Images/ImageWrapper.tsx";
interface Props {
images: any;
}
const { images } = Astro.props;
---

<MyCustomImageComponent
imagePath="/src/images/photography/cows_of_mendip_hills/cows-of-mendip-hills-3.jpg"
altText="A picture of some cows"
name="Priya"
age={25}
/>
<div class="card">
{
Object.keys(images).map((image) => {
return (
<ImageWrapper client:only>
<Image src={images[image]()} alt={"image"} />
</ImageWrapper>
);
})
}
</div>
6 changes: 5 additions & 1 deletion src/content/blog/cows-of-mendip-hills.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@ layout: '../../layouts/BaseLayout.astro'
date: "2023-11-27"
title: "The Cows of Mendip Hills"
tags: ["photography"]

---

import DummyComponent from '../../components/DummyComponent/DummyComponent.astro';
import ShittyGallery from "../../components/ImageComponent/ShittyGallery.astro";


<DummyComponent />


# The Cows of Mendip Hills

<ShittyGallery />
<ShittyGallery images={import.meta.glob(
"/src/images/photography/cows_of_mendip_hills/*.{jpeg,jpg,png,gif}"
)}/>

0 comments on commit 1c1c80a

Please sign in to comment.