aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials/docs/footer.html
diff options
context:
space:
mode:
authorCollin Brooks <collin.brooks@gmail.com>2021-04-11 10:50:54 -0500
committerGitHub <noreply@github.com>2021-04-11 17:50:54 +0200
commitba38e17b1b8140ae9254c1edc6c67ffdc50eca09 (patch)
tree1da7c8e2e123ea6cd87b9be8c9f5a7ee2d61ed74 /layouts/partials/docs/footer.html
parente2786374ada0db53a5b171f0eaeb09f7d8216891 (diff)
Add custom commit path for last edited link (#319)
- A new `BookCommitPath` paramter was added that allows the 'commit' portion of the link to a page's last edited commit hash to be specified. - This is useful when github is not the default repository for a project. Co-authored-by: Collin Brooks <cbrooks@sentryds.com>
Diffstat (limited to 'layouts/partials/docs/footer.html')
-rw-r--r--layouts/partials/docs/footer.html3
1 files changed, 2 insertions, 1 deletions
diff --git a/layouts/partials/docs/footer.html b/layouts/partials/docs/footer.html
index f38e679..7f1a08a 100644
--- a/layouts/partials/docs/footer.html
+++ b/layouts/partials/docs/footer.html
@@ -6,7 +6,8 @@
{{ if and .GitInfo .Site.Params.BookRepo }}
<div>
{{- $date := partial "docs/date" (dict "Date" .GitInfo.AuthorDate.Local "Format" .Site.Params.BookDateFormat) -}}
- <a class="flex align-center" href="{{ .Site.Params.BookRepo }}/commit/{{ .GitInfo.Hash }}" title='{{ i18n "Last modified by" }} {{ .GitInfo.AuthorName }} | {{ $date }}' target="_blank" rel="noopener">
+ {{- $commitPath := default "commit" .Site.Params.BookCommitPath -}}
+ <a class="flex align-center" href="{{ .Site.Params.BookRepo }}/{{ $commitPath }}/{{ .GitInfo.Hash }}" title='{{ i18n "Last modified by" }} {{ .GitInfo.AuthorName }} | {{ $date }}' target="_blank" rel="noopener">
<img src="{{ "svg/calendar.svg" | relURL }}" class="book-icon" alt="Calendar" />
<span>{{ $date }}</span>
</a>