Thu Dec 04 2025
Tucker McKnight <tucker@pangolin.lan>
Avoid rendering if the repo data isn't there Also, need to figure out why this happens. Seems like sometimes it tries to render the template when the page's data isn't there.
a62ca22005235b5b0b9c8d60c2a7027a83c231e7
1
const nav = NavHelper(reposConfig, slugify, data.currentRepo.name, data.currentBranch.name)
1
2
3
4
5
6
7
8
import { type Repository } from '../src/dataTypes.ts'
if (data.currentRepo === '') {
return
}
const repo: Repository = data.currentRepo
const branch: Repository['branches'][0] = data.currentBranch
const nav = NavHelper(reposConfig, slugify, repo.name, branch.name)
11
<title>${data.currentRepo.name}</title>
11
<title>${repo.name}</title>
24
<a class="nav-link" href="#">${data.currentRepo.name}</a>
24
<a class="nav-link" href="#">${repo.name}</a>
59
60
<h1 class="display-2 text-white"><em>${data.currentRepo.name}</em></h1>
${data.currentRepo.description ? '<p class="text-white fs-5">' + data.currentRepo.description + '</p>' : ''}
59
60
<h1 class="display-2 text-white"><em>${repo.name}</em></h1>
${repo.description ? '<p class="text-white fs-5">' + repo.description + '</p>' : ''}
97
<p class="font-monospace text-white">Some text with a <a href="#">link</a> in it.</p>
97
98
99
<p class="font-monospace text-white">
Latest commit: ${repo.commits.get(branch.head).hash.substr(0, 6)} ${repo.commits.get(branch.head).date.toDateString()} - ${repo.commits.get(branch.head).message}
</p>