lukeonline - commit dc31a28
feat: display simple repository data in landerdc31a28543232670c1ab3bad6f6059ba85528d06LukeJ<luke.jones.2567@gmail.com>2026-09-29T21:00:05+01:00diff --git a/src/pages/projects/[name].astro b/src/pages/projects/[name].astro
index 49a1ac9..bcc4ebe 100644
--- 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>