Rename DateFormat to BookDateFormat, make format optional

This commit is contained in:
Alex Shpak
2019-03-29 16:59:00 +01:00
parent 5b652a1bb1
commit 941ca77a32
5 changed files with 19 additions and 12 deletions
+3 -2
View File
@@ -2,8 +2,9 @@
<div class="align-center book-git-footer {{ if not .GitInfo }}justify-end{{ else }}justify-between{{ end }}">
{{ with .GitInfo }}
<div>
<a href="{{ $.Site.Params.BookRepo }}/commit/{{ .Hash }}" title='Last modified {{ .AuthorDate.Local.Format $.Site.Params.DateFormat }} by {{ .AuthorName }}' target="_blank" rel="noopener">
<img src="{{ "svg/code-merge.svg" | relURL }}" /> {{ .AuthorDate.Local.Format $.Site.Params.DateFormat }}
{{- $date := .AuthorDate.Local.Format (default "January 2, 2006" $.Site.Params.BookDateFormat) -}}
<a href="{{ $.Site.Params.BookRepo }}/commit/{{ .Hash }}" title='Last modified {{ $date }} by {{ .AuthorName }}' target="_blank" rel="noopener">
<img src="{{ "svg/code-merge.svg" | relURL }}" /> {{ $date }}
</a>
</div>
{{ end }}