diff options
author | tdro <tdro@noreply.example.com> | 2023-05-26 14:16:59 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2023-05-26 14:22:25 -0400 |
commit | a8a70edb5dceaa7bedd7b7912c758ed1e780993e (patch) | |
tree | fdb473334079b805c0f5a795d2da033cee50977f /themes/default/layouts/partials | |
parent | 2fe4908fd4cec1db8108d98dbca983e741d081e8 (diff) | |
download | canory-a8a70edb5dceaa7bedd7b7912c758ed1e780993e.tar.gz canory-a8a70edb5dceaa7bedd7b7912c758ed1e780993e.tar.bz2 canory-a8a70edb5dceaa7bedd7b7912c758ed1e780993e.zip |
themes/default/layouts/partials/navigator-middle: Support limited back tracking
Without js
Diffstat (limited to 'themes/default/layouts/partials')
-rw-r--r-- | themes/default/layouts/partials/navigator-middle.html | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/themes/default/layouts/partials/navigator-middle.html b/themes/default/layouts/partials/navigator-middle.html index 6521119..2c72120 100644 --- a/themes/default/layouts/partials/navigator-middle.html +++ b/themes/default/layouts/partials/navigator-middle.html @@ -1,8 +1,15 @@ -{{- $id := .Id -}} {{- $href := .Href -}} +{{- $id := or .Id "top" -}} +{{- $label := title $id -}} {{- $icon := readFile (print (partial "function-paths.html").static "/icons/feather/arrow-up.svg") -}} {{- $refresh := readFile (print (partial "function-paths.html").static "/icons/feather/refresh-cw.svg") -}} -{{- $label := "Top" -}} + +{{- with $paginator := .Context.Paginator -}} + {{- $href = or (and (eq $paginator.PageNumber 1) $href) + (and (gt $paginator.PageNumber 1) ($paginator.Prev.URL | absURL)) + "#" + -}} +{{- end -}} {{- with .Icon -}} {{- $icon = readFile (print (partial "function-paths.html").static "/icons/feather/" . ".svg") -}} @@ -16,8 +23,8 @@ <icon-button> <a data-update="" - id="{{ or $id "top" }}" - href="{{ or $href "#" }}" + id="{{ $id }}" + href="{{ $href }}" > {{ safeHTML $icon }} {{ safeHTML $refresh }} @@ -37,7 +44,7 @@ {{ if .Context.Site.Menus.main }} {{ range .Context.Site.Menus.main }} - <icon-navigator hidden> + <icon-navigator hidden=""> <icon-button> <a id="nav-middle-{{ path.Base .Identifier }}" href="{{ .URL | absURL }}"> {{ with .Identifier }} @@ -70,11 +77,11 @@ {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/search.svg")) }} <small>Search</small> </button> - <ul hidden id="search-results"></ul> + <ul hidden="" id="search-results"></ul> </form> </search-entry> </nav> <navigation-separator> - <hr hidden /> + <hr hidden="" /> </navigation-separator> |