diff options
author | Alex Shpak <alex-shpak@users.noreply.github.com> | 2019-11-16 21:32:23 +0100 |
---|---|---|
committer | Alex Shpak <alex-shpak@users.noreply.github.com> | 2019-11-16 21:32:23 +0100 |
commit | 1addb8dca61c80049c1e705b41737263f8b06f23 (patch) | |
tree | 58d648b73a177390ffa3a38a03792db46f58f4b4 /layouts | |
parent | aaf236410e92d7bb965d531733e16bacd31ec3ae (diff) |
Refactor footer
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/docs/footer.html | 21 | ||||
-rw-r--r-- | layouts/partials/docs/languages.html | 2 |
2 files changed, 12 insertions, 11 deletions
diff --git a/layouts/partials/docs/footer.html b/layouts/partials/docs/footer.html index ac05ae7..3a5f26e 100644 --- a/layouts/partials/docs/footer.html +++ b/layouts/partials/docs/footer.html @@ -1,24 +1,27 @@ -{{ if or .GitInfo .Site.Params.BookEditPath }} <div class="book-footer justify-between"> + {{ if .Site.IsMultiLingual }} {{ partial "docs/languages" . }} + {{ end }} + + {{ if and .GitInfo .Site.Params.BookRepo }} {{ with .GitInfo }} <div> {{ $date := .AuthorDate.Local.Format (default "January 2, 2006" $.Site.Params.BookDateFormat) }} - <a class="flex align-center" href="{{ $.Site.Params.BookRepo }}/commit/{{ .Hash }}" title='Last modified {{ $date }} by {{ .AuthorName }}' target="_blank" rel="noopener"> - <img src="{{ "svg/calendar.svg" | relURL }}" alt="Changed" /> + <a class="flex align-center" href="{{ $.Site.Params.BookRepo }}/commit/{{ .Hash }}" title='{{ i18n "Last modified by" }} {{ .AuthorName }} | {{ $date }}' target="_blank"> + <img src="{{ "svg/calendar.svg" | relURL }}" alt="Calendar" /> <span>{{ $date }}</span> </a> </div> {{ end }} - {{ with .Site.Params.BookEditPath }} + {{ end }} + + {{ if and .File .GitInfo .Site.Params.BookRepo .Site.Params.BookEditPath }} <div> - {{ if $.File }} - <a class="flex align-center" href="{{ $.Site.Params.BookRepo }}/{{ . }}/{{ $.File.Path }}" target="_blank" rel="noopener"> - <img src="{{ "svg/edit.svg" | relURL }}" alt="{{ i18n "Edit this page" }}" /> + <a class="flex align-center" href="{{ .Site.Params.BookRepo }}/{{ .Site.Params.BookEditPath }}/{{ .File.Path }}" target="_blank"> + <img src="{{ "svg/edit.svg" | relURL }}" alt="Edit" /> <span>{{ i18n "Edit this page" }}</span> </a> - {{ end }} </div> {{ end }} + </div> -{{ end }} diff --git a/layouts/partials/docs/languages.html b/layouts/partials/docs/languages.html index d905327..543cdff 100644 --- a/layouts/partials/docs/languages.html +++ b/layouts/partials/docs/languages.html @@ -1,4 +1,3 @@ -{{ if .Site.IsMultiLingual }} <!-- Merge home and current page translations --> {{ $langs := dict }} {{ range .Site.Home.AllTranslations }} @@ -29,4 +28,3 @@ </ul> </div> -{{ end }} |