lukeonline

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

commit dc31a28543232670c1ab3bad6f6059ba85528d06
parent 4dc9250e98017704a5e682984b6ca5fea3dcc908
Author: LukeJ <luke.jones.2567@gmail.com>
Date:   Tue, 29 Sep 2026 21:00:05 +0100

feat: display simple repository data in lander

Diffstat:
Msrc/pages/projects/[name].astro | 32+++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/src/pages/projects/[name].astro b/src/pages/projects/[name].astro @@ -1,7 +1,8 @@ --- import Base from '../../layouts/Base.astro' -import { getCollection, render } from 'astro:content' +import { getCollection } from 'astro:content' +import { getCommits, getTree } from '../../lib/repos' export async function getStaticPaths() { const repos = await getCollection('repos') @@ -17,7 +18,36 @@ export async function getStaticPaths() { } const { repo } = Astro.props + +const commits = getCommits(repo.data.name) +const tree = getTree(repo.data.name) --- <Base title={repo.data.name}> + <div> + default: <strong>{repo.data.defaultBranch}</strong> | <a href={`/projects/${repo.data.name}/commits`}>{repo.data.commitCount} commits</a> + </div> + <div class="flex flex-col ring ring-gray-600 rounded-sm p-2 inset-shadow-sm inset-shadow-gray-400"> + { + tree.map((file) => ( + <a href={`/projects/${repo.data.name}/files/${file.path}`} + class='p-3px px-1' + > + {file.path} + </a> + )) + } + </div> + <div class="flex flex-col"> + { + commits + .slice(-10) + .reverse() + .map((commit) => ( + <a href={`/projects/${repo.data.name}/commit/${commit.sha}`}> + <code class="text-sm">{commit.shortSha} {commit.message}</code> + </a> + )) + } + </div> </Base>