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="info-container">
<div class="left-section">
<div class="disclaimer">
<span>docs partially generated using gen ai</span>
</div>
{{ if and .File .Site.Params.BookRepo .Site.Params.BookEditPath }}
<div>
<a class="flex align-center" href="{{ .Site.Params.BookRepo }}/{{ .Site.Params.BookEditPath }}/{{ .Site.Params.contentDir | default "content" }}/{{ replace .File.Path "\\" "/" }}" target="_blank" rel="noopener">
<img src="{{ "svg/edit.svg" | relURL }}" class="book-icon" alt="" />
<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>
{{ end }}
{{ if and .GitInfo .Site.Params.BookRepo }}
<div class="commit-info">
{{- $date := partial "docs/date" (dict "Date" .GitInfo.AuthorDate.Local "Format" .Site.Params.BookDateFormat) -}}
{{- $commitPath := default "commit" .Site.Params.BookCommitPath -}}
<span>Last edited</span>
<br />
<span>
commit <a href="{{ .Site.Params.BookRepo }}/{{ $commitPath }}/{{ .GitInfo.Hash }}" target="_blank" rel="noopener">{{ .GitInfo.Hash }}</a>
</span>
<br />
<span>
author: {{ .GitInfo.AuthorName }} &lt;{{ .GitInfo.AuthorEmail }}&gt;
</span>
<br />
<span>
date: {{ $date }}
</span>
</div>
{{ end }}
<div class="commit-info">
<span>Last edited on {{ .GitInfo.CommitDate.Format "02/01/2006" }}</span>
<br/>
<span>
title: {{ .GitInfo.Subject }}
</span>
<br/>
<span>
commit: <a href="{{ .Site.Params.BookRepo }}/{{ .Site.Params.BookCommitPath }}/{{ .GitInfo.Hash }}" target="_blank" rel="noopener">{{ .GitInfo.AbbreviatedHash }}</a>
</span>
<br/>
<span>
author: {{ .GitInfo.AuthorName }}
</span>
<br/>
<span>
&lt;{{ .GitInfo.AuthorEmail }}&gt;
</div>
</div>