added commit info

This commit is contained in:
aethrvmn 2024-10-04 13:25:33 +02:00
parent 492d87d365
commit 26b996f07f

View file

@ -1,37 +1,37 @@
<div class="flex flex-wrap justify-between"> <div class="flex flex-wrap justify-between">
<div class="info-container">
{{ if and .File .Site.Params.BookRepo .Site.Params.BookEditPath }} <div class="left-section">
<div> <div class="disclaimer">
<a class="flex align-center" href="{{ .Site.Params.BookRepo }}/{{ .Site.Params.BookEditPath }}/{{ .Site.Params.contentDir | default "content" }}/{{ replace .File.Path "\\" "/" }}" target="_blank" rel="noopener"> <span>docs partially generated using gen ai</span>
<img src="{{ "svg/edit.svg" | relURL }}" class="book-icon" alt="" /> </div>
<span>{{ i18n "Edit this page" }}</span>
</a> <div class="theme">
<span>
site theme based on <a href="https://github.com/alex-shpak/hugo-book" target="_blank">hugo-book</a>
</span>
</div>
</div> </div>
{{ end }}
{{ if and .GitInfo .Site.Params.BookRepo }}
<div class="commit-info"> <div class="commit-info">
{{- $date := partial "docs/date" (dict "Date" .GitInfo.AuthorDate.Local "Format" .Site.Params.BookDateFormat) -}} <span>Last edited on {{ .GitInfo.CommitDate.Format "02/01/2006" }}</span>
{{- $commitPath := default "commit" .Site.Params.BookCommitPath -}} <br/>
<span>Last edited</span>
<br />
<span> <span>
commit <a href="{{ .Site.Params.BookRepo }}/{{ $commitPath }}/{{ .GitInfo.Hash }}" target="_blank" rel="noopener">{{ .GitInfo.Hash }}</a> title: {{ .GitInfo.Subject }}
</span> </span>
<br /> <br/>
<span> <span>
author: {{ .GitInfo.AuthorName }} &lt;{{ .GitInfo.AuthorEmail }}&gt; commit: <a href="{{ .Site.Params.BookRepo }}/{{ .Site.Params.BookCommitPath }}/{{ .GitInfo.Hash }}" target="_blank" rel="noopener">{{ .GitInfo.AbbreviatedHash }}</a>
</span> </span>
<br /> <br/>
<span> <span>
date: {{ $date }} author: {{ .GitInfo.AuthorName }}
</span> </span>
<br/>
<span>
&lt;{{ .GitInfo.AuthorEmail }}&gt;
</div> </div>
{{ end }}
</div> </div>