Get unique committers in hugo

I did

this:

    {{ if and (or .IsPage .IsSection) .Site.Params.contentCommitsURL }}
         {{ $File := .File }}
         {{ $Site := .Site }}
         {{with $File.Path }}
         {{ $fileDir := replace $File.Dir "\\" "/"}}
              {{ $url := $File.LogicalName | printf "%s%s" $fileDir | printf "%s%s" $Site.Params.contentCommitsURL }}
              {{ $.Scratch.Set "url" $url }}
         {{ end }}
    {{ end }}

    {{ $url := $.Scratch.Get "url"}}
    {{ range getJSON $url }}
    <div style="display:inline-block; width:40px;">
      <a href="{{.author.html_url}}" target="_blank">
        <img src="{{.author.avatar_url}}" alt="{{.author.login}}" text="{{.author.login}}" class="inline" width="40" height="40" style="height: 40px;height: 40px; vertical-align:middle; margin: 0 auto;">
      </a>
    </div>
    {{ end }}

to achieve an equivalent of this:

const githubAPI = "https://api.github.com"
const commitsEndpoint = "/repos/csitauthority/CSITauthority.github.io/commits"
const commitsURL = githubAPI + commitsEndpoint
const filepath = "HUGO/content/post/vlan-101.md"
fetch(commitsURL + "?path=" + filepath)
  .then(response => response.json())
  .then(commits => {
    for (var i = 0; i < commits.length; i++) {
      console.log(commits[i].commit.author.name)
    }
  })

What would be an equivalent, in HUGO, for the following?

const githubAPI = "https://api.github.com"
const commitsEndpoint = "/repos/csitauthority/CSITauthority.github.io/commits"
const commitsURL = githubAPI + commitsEndpoint
const filepath = "HUGO/content/post/grandfather-problem.md"
fetch(commitsURL + "?path=" + filepath)
  .then(response => response.json())
  .then(commits => {
    const names = [];
    for (var i = 0; i < commits.length; i++) {
      if (!names.includes(commits[i].commit.author.name)) {
        names.push(commits[i].commit.author.name);
      }
    }
    console.log(names.join("\n"));
  })

I am trying to

  1. show all the commits made to a file(post, actually) when I post.
  2. The committer must be unique. ie. No committer should show up more than once (the js above satisfies this rule)

Screenshots
SCROLL THIS WAY --------------------->>

What’s happening now What I’m trying to achieve

I know you can get the latest commit natively with Hugo. As for the history it might need a script to grab that from the git log, then put it in a manifest, under data, to then access later in templates.

This is something I made before it was baked in to Hugo.

See the solution to a similar problem.