.GitInfo on page and global resources

{{ with resources.Get "non-disclosure-agreement.pdf" }}
  <div class="legal-document">
    <div class="download-link">
      <a href="{{ .RelPermalink }}" download>{{ .Name }}</a>
    </div>
    {{ with .GitInfo }}
      <div class="last-modification-date">
        <p>Last modified on {{ .AuthorDate }}</p>
      </div>
    {{ end }}
  </div>
{{ end }}

The alternative is to query the local repository via CLI and stuff what’s needed into data/git.toml… which is a trivial exercise.

1 Like