Make branches template use commonPage

cb7f690c5a3a45c80e584f7fb02084eabfc63f56

Tucker McKnight <tucker@pangolin.lan> | Sun Feb 22 2026

Make branches template use commonPage
js_templates/branches.ts:1
Before
1
  nav: ReturnType<typeof NavHelper>
After
1
import htmlPage from './common/htmlPage.ts'
  reposConfig: any,
  const nav = NavHelper(reposConfig, slugify, data.branchInfo.repoName, data.branchInfo.branchName)
js_templates/branches.ts:34
Before
34
  return [
After
34
  const pageContent = [

  return await htmlPage(reposConfig, eleventyConfig, data, pageContent)
main.ts:19
Before
19
// import branchesJsTemplate from './js_templates/branches.ts'
After
19
import branchesJsTemplate from './js_templates/branches.ts'
main.ts:277
Before
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",
  //   }
  // )
After
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",
    }
  )