lukeonline

source for my website
git clone https://git.lukeonline.net/repos/lukeonline
Log | Files | Refs | README | LICENSE

commit c337c485bb87f9d74c31028015bb25c7e61d127c
parent 6abbfe563c13733f866ec3efd2f66932c808f923
Author: LukeJ <luke.jones.2567@gmail.com>
Date:   Wed, 15 Jul 2026 20:01:25 +0100

fix: correct blog rendering

Diffstat:
Msrc/layouts/ContentList.astro | 14++++++++------
Msrc/pages/blog/index.astro | 6+++---
2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/layouts/ContentList.astro b/src/layouts/ContentList.astro @@ -5,10 +5,12 @@ const { ...props } = Astro.props; --- <Base title={props.title}> <slot /> - {props.content.map(post => ( - <div> - <span>{post.title}</span> - <span>{post.desc}</span> - </div> - ))} + <div class="flex flex-col gap-2"> + {props.content.map(post => ( + <a class="flex flex-col"> + <span>{post.title}</span> + <span class="text-sm font-light">{post.desc}</span> + </a> + ))} + </div> </Base> diff --git a/src/pages/blog/index.astro b/src/pages/blog/index.astro @@ -6,13 +6,13 @@ import { getCollection, getEntry } from 'astro:content'; const title = "Blog"; -const blogPosts = await getCollection('blog'); +const posts = await getCollection('blog'); -const contentData = blogPosts.map((post) => ({ +const contentData = posts.map((post) => ({ title: post.data.title, desc: `${post.data.desc} - ${post.data.date.toLocaleDateString()}` })); -console.log('POSTS: ', blogPosts) +console.log('POSTS: ', posts) --- <ContentList title={title} content={contentData} />