lukeonline

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

commit 62196e90c66f4ac5c704001f6151a1b3488d2f94
parent 4084ccf8ffa6934c2b22afe812acd1d4217e88c7
Author: LukeJ <luke.jones.2567@gmail.com>
Date:   Tue, 29 Sep 2026 22:14:43 +0100

feat: display commit diffs

Diffstat:
Asrc/pages/projects/[name]/commit/[sha].astro | 38++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+), 0 deletions(-)

diff --git a/src/pages/projects/[name]/commit/[sha].astro b/src/pages/projects/[name]/commit/[sha].astro @@ -0,0 +1,38 @@ +--- +import { getCollection } from 'astro:content' +import { getCommit, getCommits } from '../../../../lib/repos' +import Base from '../../../../layouts/Base.astro' +import CodeContainer from '../../../../components/CodeContainer.astro' + +export async function getStaticPaths() { + const repos = await getCollection('repos') + + return repos.flatMap((repo) => { + const commits = getCommits(repo.data.name) + + return commits.map((commit) => ({ + params: { + name: repo.data.name, + sha: commit.sha, + }, + props: { + repo, + commit: getCommit(repo.data.name, commit.sha), + }, + })) + }) +} + +const { repo, commit } = Astro.props +--- + +<Base title={`${repo.data.name} - commit ${commit.shortSha}`}> + <div class="flex flex-col text-sm"> + <code>{commit.message}</code> + <code>{commit.sha}</code> + <code>{commit.author.name}</code> + <code>&lt;{commit.author.email}&gt;</code> + <code>{commit.date}</code> + </div> + <CodeContainer code={commit.diff} /> +</Base>