Skip to content

Commit

Permalink
Updated file
Browse files Browse the repository at this point in the history
  • Loading branch information
harrisoncramer committed Apr 30, 2024
1 parent b0bb38b commit 4d40622
Showing 1 changed file with 30 additions and 32 deletions.
62 changes: 30 additions & 32 deletions src/pages/blog.astro
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ const entries = await contentfulClient.getEntries<Blog>({
content_type: "blog",
});
console.log(entries.items)
const items = entries.items.map(({ fields }) => {
return {
...fields,
Expand All @@ -34,37 +32,37 @@ const items = entries.items.map(({ fields }) => {
---

<Layout title="blog">
<div class="blog-wrapper">
<h2 class="mt-8 px-2 text-app-theme">Blog Posts</h2>
<div class="grid pt-6 gap-6 gap-y-8 lg:grid-cols-3 md:grid-cols-3 sm:grid-cols-2 max-w-max m-auto">
{
items.map(({ title, description, mainImage, slug, date, summary }) => {
return (
<div class="flex flex-col">
<RecipeTitle title={title} />
<a href={`/blog/${slug}`}>
<div class="relative group flex-1">
{mainImage.fields.file?.url && (
<Image
height={420}
aspectRatio={1}
alt={title}
src={mainImage.fields.file?.url}
class="md:hover:cursor-pointer transition md:group-hover:opacity-20 duration-300 w-full object-cover h-full"
/>
)}
</div>
<time class="font-sans block mb-2">
<small>{date}</small>
<p class="mt-2">{summary}</p>
</time>
</a>
</div>
);
})
}
</div>
<div class="blog-wrapper">
<h2 class="mt-8 px-2 text-app-theme">Blog Posts</h2>
<div class="grid pt-6 gap-6 gap-y-8 lg:grid-cols-3 md:grid-cols-3 sm:grid-cols-2 max-w-max m-auto">
{
items.map(({ title, description, mainImage, slug, date, summary }) => {
return (
<div class="flex flex-col">
<RecipeTitle title={title} />
<a href={`/blog/${slug}`}>
<div class="relative group flex-1">
{mainImage.fields.file?.url && (
<Image
height={420}
aspectRatio={1}
alt={title}
src={mainImage.fields.file?.url}
class="md:hover:cursor-pointer transition md:group-hover:opacity-20 duration-300 w-full object-cover h-full"
/>
)}
</div>
<time class="font-sans block mb-2">
<small>{date}</small>
<p class="mt-2">{summary}</p>
</time>
</a>
</div>
);
})
}
</div>
</div>
</Layout>
<style>
.blog-wrapper {
Expand Down

0 comments on commit 4d40622

Please sign in to comment.