diff options
Diffstat (limited to 'documentation/themes/beastie/layouts/books/list.html')
-rw-r--r-- | documentation/themes/beastie/layouts/books/list.html | 62 |
1 files changed, 60 insertions, 2 deletions
diff --git a/documentation/themes/beastie/layouts/books/list.html b/documentation/themes/beastie/layouts/books/list.html index e264c4b728..3d9dcf16b4 100644 --- a/documentation/themes/beastie/layouts/books/list.html +++ b/documentation/themes/beastie/layouts/books/list.html @@ -3,7 +3,19 @@ <div class="navheader"> <div class="prev"> {{ if .Params.prev }} - <a href={{ .Params.Prev | absLangURL }}>{{ i18n "prev" }}</a> + {{ if $.Site.Params.isOnline }} + <a href={{ .Params.Prev | absLangURL }}>{{ i18n "prev" }}</a> + {{ else }} + {{ $pathSectionsPrev := split .Params.Prev "/" }} + + {{if eq (len $pathSectionsPrev) 3}} + {{ $path := index $pathSectionsPrev 2 }} + <a href=../{{ $path }}/index.html>{{ i18n "prev" }}</a> + {{ end }} + {{if eq (len $pathSectionsPrev) 2}} + <a href=../index.html>{{ i18n "prev" }}</a> + {{ end }} + {{ end }} {{ end }} </div> <div class="chapter"> @@ -14,7 +26,24 @@ </div> <div class="next"> {{ if .Params.next }} + {{ if $.Site.Params.isOnline }} <a href={{ .Params.Next | absLangURL }}>{{ i18n "next" }}</a> + {{ else }} + {{ $pathSectionsNext := split .Params.Next "/" }} + {{if eq (len $pathSectionsNext) 3}} + {{ if .Params.isIndex }} + {{ $book := index $pathSectionsNext 1 }} + {{ $path := index $pathSectionsNext 2 }} + <a href=../{{ $book }}/{{ $path }}/index.html>{{ i18n "next" }}</a> + {{ else }} + {{ $path := index $pathSectionsNext 2 }} + <a href=../{{ $path }}/index.html>{{ i18n "next" }}</a> + {{ end }} + {{ end }} + {{if eq (len $pathSectionsNext) 2}} + <a href=../index.html>{{ i18n "next" }}</a> + {{ end }} + {{ end }} {{ end }} </div> </div> @@ -97,7 +126,19 @@ <div class="navfooter"> <div class="prev"> {{ if .Params.prev }} - <a href={{ .Params.Prev | absLangURL }}>{{ i18n "prev" }}</a> + {{ if $.Site.Params.isOnline }} + <a href={{ .Params.Prev | absLangURL }}>{{ i18n "prev" }}</a> + {{ else }} + {{ $pathSectionsPrev := split .Params.Prev "/" }} + + {{if eq (len $pathSectionsPrev) 3}} + {{ $path := index $pathSectionsPrev 2 }} + <a href=../{{ $path }}/index.html>{{ i18n "prev" }}</a> + {{ end }} + {{if eq (len $pathSectionsPrev) 2}} + <a href=../index.html>{{ i18n "prev" }}</a> + {{ end }} + {{ end }} {{ end }} </div> <div class="home"> @@ -105,7 +146,24 @@ </div> <div class="next"> {{ if .Params.next }} + {{ if $.Site.Params.isOnline }} <a href={{ .Params.Next | absLangURL }}>{{ i18n "next" }}</a> + {{ else }} + {{ $pathSectionsNext := split .Params.Next "/" }} + {{if eq (len $pathSectionsNext) 3}} + {{ if .Params.isIndex }} + {{ $book := index $pathSectionsNext 1 }} + {{ $path := index $pathSectionsNext 2 }} + <a href=../{{ $book }}/{{ $path }}/index.html>{{ i18n "next" }}</a> + {{ else }} + {{ $path := index $pathSectionsNext 2 }} + <a href=../{{ $path }}/index.html>{{ i18n "next" }}</a> + {{ end }} + {{ end }} + {{if eq (len $pathSectionsNext) 2}} + <a href=../index.html>{{ i18n "next" }}</a> + {{ end }} + {{ end }} {{ end }} </div> </div> |