Make the "latest commit overall" section work

f800ab155c55484672b34d9b0706aaec20c14342

Tucker McKnight <tmcknight@instructure.com> | Mon Jul 20 2026

Make the "latest commit overall" section work
js_templates/repo.ts:14
Before
13
14
15


16
17
    ? latestCommit.message.split('\n')[0].substr(0, 72) + '...'
    : latestCommit.message

⁣
⁣
  const nav = NavHelper({
    reposConfig,
    slugify,
After
13
14
15
16
17
18
19
    ? latestCommit.message.split('\n')[0].substr(0, 72) + '...'
    : latestCommit.message

  const mostRecentCommitOverall = data.mostRecentCommitsOverall[repo.name]

  const nav = NavHelper({
    reposConfig,
    slugify,
js_templates/repo.ts:104
Before
103
104
105
106



107
108
109
110






111
112
113
                      m('div', {class: "text-white mb-2 d-inline-block"}, [
                        m('div', {class: "fs-5 fw-light"}, 'Latest commit overall'),
                        m('div', {class: "font-monospace"}, [
                          'Jul 04 2026 ',
⁣
⁣
⁣
                          m('a', {href: "", class: "link-info fw-bold"}, 'b1c071')
                        ]),
                        m('span', {class: "fw-light"}, [
                          'in branch ',
⁣
⁣
⁣
⁣
⁣
⁣
                          m('a', {href: "", class: "link-info"}, 'one-page-per-commit'),
                        ])
                      ])
                    ])
After
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
                      m('div', {class: "text-white mb-2 d-inline-block"}, [
                        m('div', {class: "fs-5 fw-light"}, 'Latest commit overall'),
                        m('div', {class: "font-monospace"}, [
                          `${mostRecentCommitOverall.commit.date.toDateString().split(' ').slice(1).join(' ')} `,
                          m('a', {
                            href: nav.commit(mostRecentCommitOverall.commit.hash),
                            class: "link-info fw-bold"
                          }, mostRecentCommitOverall.commit.hash.substr(0, 6))
                        ]),
                        m('span', {class: "fw-light"}, [
                          'in branch ',
                          m('a', {
                            href: nav.commits(1, {
                              refName: mostRecentCommitOverall.branch.name,
                              refType: 'branch',
                            }),
                            class: "link-info"
                          }, mostRecentCommitOverall.branch.name),
                        ])
                      ])
                    ])
main.ts:101
Before
100
101
102





















103
104
  const flatRefs = getFlatRefs(reposData)
  eleventyConfig.addGlobalData("flatRefs", flatRefs)

⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
  eleventyConfig.addFilter("getFileName", (filePath: string) => {
    const pathParts = filePath.split("/")
    return pathParts[pathParts.length - 1]
After
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
  const flatRefs = getFlatRefs(reposData)
  eleventyConfig.addGlobalData("flatRefs", flatRefs)

  const mostRecentCommitsOverall = {}
  reposData.forEach((repo) => {
    const startingValue = {
      commit: repo.commits.get(repo.branches[0].sha),
      branch: repo.branches[0],
    }
    const newestCommit = repo.branches.reduce((newestCommit, currentBranch) => {
      const currentBranchCommit = repo.commits.get(currentBranch.sha)
      return currentBranchCommit.date > newestCommit.commit.date
        ? {
            commit: currentBranchCommit,
            branch: currentBranch
          }
        : newestCommit
    }, startingValue)

    mostRecentCommitsOverall[repo.name] = newestCommit
  })

  eleventyConfig.addGlobalData('mostRecentCommitsOverall', mostRecentCommitsOverall)

  eleventyConfig.addFilter("getFileName", (filePath: string) => {
    const pathParts = filePath.split("/")
    return pathParts[pathParts.length - 1]