Tucker McKnight <tucker@pangolin.lan> | Sun Feb 22 2026
Make branches template use commonPage
1
nav: ReturnType<typeof NavHelper>1
import htmlPage from './common/htmlPage.ts'
reposConfig: any,
const nav = NavHelper(reposConfig, slugify, data.branchInfo.repoName, data.branchInfo.branchName)34
return [34
const pageContent = [
return await htmlPage(reposConfig, eleventyConfig, data, pageContent)19
// import branchesJsTemplate from './js_templates/branches.ts'19
import branchesJsTemplate from './js_templates/branches.ts'277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308
// eleventyConfig.addTemplate(
// 'repos/branches.11ty.js',
// htmlPage(reposConfiguration, eleventyConfig, branchesJsTemplate),
// {
// pagination: {
// data: "branches",
// size: 1,
// alias: "branchInfo",
// },
// permalink: (data) => {
// const repoName = data.branchInfo.repoName
// const branchName = data.branchInfo.branchName
// return `${reposPath}/${eleventyConfig.getFilter("slugify")(repoName)}/branches/${eleventyConfig.getFilter("slugify")(branchName)}/branches/`
// },
// eleventyComputed: {
// nav: {
// repoName: (data) => data.branchInfo.repoName,
// branchName: (data) => data.branchInfo.branchName,
// path: "branches"
// },
// currentRepo: (data) => reposData.find(repo => {
// return repo.name === data.branchInfo.repoName
// }),
// currentBranch: (data) => reposData.find(repo => {
// return repo.name === data.branchInfo.repoName
// }).branches.find(branch => {
// return branch.name === data.branchInfo.branchName
// }),
// },
// navTab: "branches",
// }
// )277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308
eleventyConfig.addTemplate(
'repos/branches.11ty.js',
commonPage(branchesJsTemplate, reposConfiguration, eleventyConfig),
{
pagination: {
data: "branches",
size: 1,
alias: "branchInfo",
},
permalink: (data) => {
const repoName = data.branchInfo.repoName
const branchName = data.branchInfo.branchName
return `${reposPath}/${eleventyConfig.getFilter("slugify")(repoName)}/branches/${eleventyConfig.getFilter("slugify")(branchName)}/branches/`
},
eleventyComputed: {
nav: {
repoName: (data) => data.branchInfo.repoName,
branchName: (data) => data.branchInfo.branchName,
path: "branches"
},
currentRepo: (data) => reposData.find(repo => {
return repo.name === data.branchInfo.repoName
}),
currentBranch: (data) => reposData.find(repo => {
return repo.name === data.branchInfo.repoName
}).branches.find(branch => {
return branch.name === data.branchInfo.branchName
}),
},
navTab: "branches",
}
)