Tucker McKnight <tucker@pangolin.lan> | Sun Feb 22 2026
Make commits template use commonPage
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
import m from 'mithril'
import {NavHelper} from './helpers/nav.ts'
export default async (
eleventyConfig: any,
data: any,
nav: ReturnType<typeof NavHelper>
) => {
const pagesJustForBranch = eleventyConfig.getFilter("pagesJustForBranch")
const slugify = eleventyConfig.getFilter("slugify")
const date = eleventyConfig.getFilter("date")
return [
m('div', {class: "row mt-3 mb-1"},
m('div', {class: "col"},
m('p', {class: "d-inline-block"}, [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
import m from 'mithril'
import {NavHelper} from './helpers/nav.ts'
import htmlPage from './common/htmlPage.ts'
export default async (
reposConfig: any,
eleventyConfig: any,
data: any,
) => {
const pagesJustForBranch = eleventyConfig.getFilter("pagesJustForBranch")
const slugify = eleventyConfig.getFilter("slugify")
const date = eleventyConfig.getFilter("date")
const nav = NavHelper(reposConfig, slugify, data.patchPage.repoName, data.patchPage.branchName)
const pageContent = [
m('div', {class: "row mt-3 mb-1"},
m('div', {class: "col"},
m('p', {class: "d-inline-block"}, [78 79 80
)
)
]
}78 79 80 81 82
)
)
]
return await htmlPage(reposConfig, eleventyConfig, data, pageContent)
}16 17 18 19 20 21
import filesJsTemplate from './js_templates/files.ts'
import fileJsTemplate from './js_templates/file.ts'
import commitJsTemplate from './js_templates/commit.ts'
// import commitsJsTemplate from './js_templates/commits.ts'
import indexJsTemplate from './js_templates/index.ts'
// import branchesJsTemplate from './js_templates/branches.ts'
import rawJsTemplate from './js_templates/raw.ts'16 17 18 19 20 21
import filesJsTemplate from './js_templates/files.ts'
import fileJsTemplate from './js_templates/file.ts'
import commitJsTemplate from './js_templates/commit.ts'
import commitsJsTemplate from './js_templates/commits.ts'
import indexJsTemplate from './js_templates/index.ts'
// import branchesJsTemplate from './js_templates/branches.ts'
import rawJsTemplate from './js_templates/raw.ts'434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472
)
// COMMITS.TS
// const paginatedPatchesData = await paginatedPatches(reposData)
// eleventyConfig.addTemplate(
// `repos/patches.11ty.js`,
// htmlPage(reposConfiguration, eleventyConfig, commitsJsTemplate),
// {
// pagination: {
// data: "paginatedPatches",
// size: 1,
// alias: "patchPage",
// },
// paginatedPatches: paginatedPatchesData,
// permalink: (data) => {
// const repoName = data.patchPage.repoName
// const branchName = data.patchPage.branchName
// return `${reposPath}/${eleventyConfig.getFilter("slugify")(repoName)}/branches/${eleventyConfig.getFilter("slugify")(branchName)}/commits/page${data.patchPage.pageNumber}/`
// },
// eleventyComputed: {
// nav: {
// repoName: (data) => data.patchPage.repoName,
// branchName: (data) => data.patchPage.branchName,
// path: 'commits/page1',
// },
// currentRepo: (data) => reposData.find(repo => {
// return repo.name === data.patchPage.repoName
// }),
// currentBranch: (data) => reposData.find(repo => {
// return repo.name === data.patchPage.repoName
// }).branches.find(branch => {
// return branch.name === data.patchPage.branchName
// }),
// },
// navTab: "commits",
// }
// )
// COMMIT.TS
const flatPatchesData = await flatPatches(reposData)434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472
)
// COMMITS.TS
const paginatedPatchesData = await paginatedPatches(reposData)
eleventyConfig.addTemplate(
`repos/patches.11ty.js`,
commonPage(commitsJsTemplate, reposConfiguration, eleventyConfig),
{
pagination: {
data: "paginatedPatches",
size: 1,
alias: "patchPage",
},
paginatedPatches: paginatedPatchesData,
permalink: (data) => {
const repoName = data.patchPage.repoName
const branchName = data.patchPage.branchName
return `${reposPath}/${eleventyConfig.getFilter("slugify")(repoName)}/branches/${eleventyConfig.getFilter("slugify")(branchName)}/commits/page${data.patchPage.pageNumber}/`
},
eleventyComputed: {
nav: {
repoName: (data) => data.patchPage.repoName,
branchName: (data) => data.patchPage.branchName,
path: 'commits/page1',
},
currentRepo: (data) => reposData.find(repo => {
return repo.name === data.patchPage.repoName
}),
currentBranch: (data) => reposData.find(repo => {
return repo.name === data.patchPage.repoName
}).branches.find(branch => {
return branch.name === data.patchPage.branchName
}),
},
navTab: "commits",
}
)
// COMMIT.TS
const flatPatchesData = await flatPatches(reposData)