lukeonline

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

commit 392ff6507842424baae185e93e5b57256c27a419
parent a0dde794468d38472a2c5fa1aa3aae799ae1fb0c
Author: Luke Jones <lukep@donovan.local>
Date:   Thu, 16 Jul 2026 23:42:17 +0100

feat: blog header and refactor

Diffstat:
Msrc/components/Header.astro | 2+-
Asrc/pages/blog/[id].astro | 35+++++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/src/components/Header.astro b/src/components/Header.astro @@ -4,7 +4,7 @@ const { title } = Astro.props; const linkStyling = "hover:bg-gray-300 grow text-center" --- <header class="flex flex-col gap-1"> - <h1 class="text-2xl font-bold">Luke Jones</h1> + <span class="text-2xl font-bold">Luke Jones</span> <nav class="flex flex-row justify-between"> <a class={linkStyling} href="/">Home</a> <a class={linkStyling} href="/projects">Projects</a> diff --git a/src/pages/blog/[id].astro b/src/pages/blog/[id].astro @@ -0,0 +1,35 @@ +--- +import Base from "../../layouts/Base.astro"; + +import { getCollection, render } from "astro:content"; + +export async function getStaticPaths() { + const posts = await getCollection("blog"); + + return posts.map((post) => ({ + params: { + id: post.id, + }, + props: { + post, + }, + })); +} + +const { post } = Astro.props; +const { Content } = await render(post); + +console.log(post) +--- +<Base title={post.data.title}> + <div class="flex flex-col gap-6"> + <div class="flex flex-col gap-2"> + <span class="flex flex-col"> + <h1 class="text-2xl font-medium">{post.data.title}</h1> + <span class="text-sm font-light">{post.data.date.toDateString()}</span> + </span> + <span>{post.data.desc}</span> + </div> + <Content /> + </div> +</Base>