Tucker McKnight <tmcknight@instructure.com> | Thu Feb 19 2026
Make repo page use commonPage
1
export default async (eleventyConfig: any, data: any, nav: ReturnType<typeof NavHelper>) => {1
import htmlPage from './common/htmlPage.ts'
export default async (reposConfig: any, eleventyConfig: any, data: any) => {
const slugify = eleventyConfig.getFilter("slugify")
const nav = NavHelper(reposConfig, slugify, repo.name, branch.name)
44
return [44
const pageContent = [117
117
return await htmlPage(reposConfig, eleventyConfig, data, pageContent)13
// import repoJsTemplate from './js_templates/repo.ts'13
import repoJsTemplate from './js_templates/repo.ts'401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432
// eleventyConfig.addTemplate(
// 'repos/repo.11ty.js',
// htmlPage(reposConfiguration, eleventyConfig, repoJsTemplate),
// {
// pagination: {
// data: "branches",
// size: 1,
// alias: "branch",
// },
// permalink: (data) => {
// const repoName = data.branch.repoName
// const branchName = data.branch.branchName
// return `${reposPath}/${eleventyConfig.getFilter("slugify")(repoName)}/branches/${eleventyConfig.getFilter("slugify")(branchName)}/`
// },
// eleventyComputed: {
// nav: {
// repoName: (data) => data.branch.repoName,
// branchName: (data) => data.branch.branchName,
// path: (data) => '', // ask about why empty string here shows up as a function
// },
// currentRepo: (data) => reposData.find(repo => {
// return repo.name === data.branch.repoName
// }),
// currentBranch: (data) => reposData.find(repo => {
// return repo.name === data.branch.repoName
// }).branches.find(branch => {
// return branch.name === data.branch.branchName
// }),
// },
// navTab: "home"
// }
// )401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432
eleventyConfig.addTemplate(
'repos/repo.11ty.js',
commonPage(repoJsTemplate, reposConfiguration, eleventyConfig),
{
pagination: {
data: "branches",
size: 1,
alias: "branch",
},
permalink: (data) => {
const repoName = data.branch.repoName
const branchName = data.branch.branchName
return `${reposPath}/${eleventyConfig.getFilter("slugify")(repoName)}/branches/${eleventyConfig.getFilter("slugify")(branchName)}/`
},
eleventyComputed: {
nav: {
repoName: (data) => data.branch.repoName,
branchName: (data) => data.branch.branchName,
path: (data) => '', // ask about why empty string here shows up as a function
},
currentRepo: (data) => reposData.find(repo => {
return repo.name === data.branch.repoName
}),
currentBranch: (data) => reposData.find(repo => {
return repo.name === data.branch.repoName
}).branches.find(branch => {
return branch.name === data.branch.branchName
}),
},
navTab: "home"
}
)