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,
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]