Skip to content

Commit

Permalink
theme: print out GitInfo in page footer if configured #786
Browse files Browse the repository at this point in the history
  • Loading branch information
McShelby committed Feb 29, 2024
1 parent 0d6fff1 commit 02be3c3
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
4 changes: 4 additions & 0 deletions exampleSite/content/basics/migration/_index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ This document shows you what's new in the latest release and flags it with one o

---

## 5.25.0.beta (XXX) {#5250}

- {{% badge style="note" title=" " %}}Change{{% /badge %}} If you run Hugo with [GitInfo](https://gohugo.io/methods/page/gitinfo/) configured, the default page footer now prints out name, email address and date of the last commit. If you want to turn this off you either have to run Hugo without GitInfo (which is the default) or overwrite the `content-footer.html' partial.

## 5.24.0 (2024-02-28) {#5240}

- {{% badge color="fuchsia" icon="fab fa-hackerrank" title=" " %}}0.112.4{{% /badge %}} This release requires a newer Hugo version.
Expand Down
32 changes: 28 additions & 4 deletions layouts/partials/content-footer.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
{{- with .Params.LastModifierDisplayName }}
<i class='fas fa-user'></i> {{ with $.Params.LastModifierEmail }}<a href="mailto:{{ . }}">{{ end }}{{ . }}{{ with $.Params.LastModifierEmail }}</a>{{ end }}
{{- with $.Date }}
<i class='fas fa-calendar'></i> {{ . | time.Format ":date_medium" }}
{{- $LastModifierDisplayName := "" }}
{{- $LastModifierEmail := "" }}
{{- $Date := "" }}
{{- with .GitInfo }}
{{- with .AuthorName }}
{{- $LastModifierDisplayName = . }}
{{- end }}
{{- with .AuthorEmail }}
{{- $LastModifierEmail = . }}
{{- end }}
{{- with .AuthorDate }}
{{- $Date = . | time.Format ":date_medium" }}
{{- end }}
{{- else }}
{{- with .Params.LastModifierDisplayName }}
{{- $LastModifierDisplayName = . }}
{{- end }}
{{- with .Params.LastModifierEmail }}
{{- $LastModifierEmail = . }}
{{- end }}
{{- with .Date }}
{{- $Date = . | time.Format ":date_medium" }}
{{- end }}
{{- end }}
{{- if $LastModifierDisplayName }}
<i class='fas fa-user'></i> {{ with $LastModifierEmail }}<a href="mailto:{{ . }}">{{ end }}{{ $LastModifierDisplayName }}{{ with $LastModifierEmail }}</a>{{ end }}
{{- with $Date }}
<i class='fas fa-calendar'></i> {{ . }}
{{- end }}
{{- end }}
{{- partial "term-list.html" (dict
Expand Down

0 comments on commit 02be3c3

Please sign in to comment.