diff options
| author | aethrvmn <me@aethrvmn.gr> | 2025-09-20 22:27:35 +0000 |
|---|---|---|
| committer | aethrvmn <me@aethrvmn.gr> | 2025-09-20 22:27:35 +0000 |
| commit | 9b5f3fad7068298265dbbc8a65077f7917a090a5 (patch) | |
| tree | 0905b29eb7c03d6bc6e16dd1ebcd1ec9b6b83320 /themes/hugo-book/layouts/_partials/docs/prev-next.html | |
| parent | super simple setup guide (diff) | |
updated hugo-book theme
Diffstat (limited to '')
| -rw-r--r-- | themes/hugo-book/layouts/_partials/docs/prev-next.html | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/themes/hugo-book/layouts/_partials/docs/prev-next.html b/themes/hugo-book/layouts/_partials/docs/prev-next.html new file mode 100644 index 0000000..d93e5ed --- /dev/null +++ b/themes/hugo-book/layouts/_partials/docs/prev-next.html @@ -0,0 +1,31 @@ +{{ $bookSection := default "docs" .Site.Params.BookSection }} +{{ if eq $bookSection "*" }} + {{ $bookSection = "/" }}{{/* Backward compatibility */}} +{{ end }} + +{{ with .Site.GetPage $bookSection }} + {{ $pages := partialCached "docs/prev-next-cache" .Pages }} + {{ $prev := $pages.Next $ }} + {{ $next := $pages.Prev $ }} + + {{- if or $prev $next }} + <div class="flex flex-wrap justify-between"> + <span> + {{ with $prev }} + <a href="{{ .RelPermalink }}" class="flex align-center"> + <img src="{{ "svg/backward.svg" | relURL }}" class="book-icon" alt="Previous" title="{{ partial "docs/title" . }}" /> + <span>{{ partial "docs/title" . }}</span> + </a> + {{ end }} + </span> + <span> + {{ with $next }} + <a href="{{ .RelPermalink }}" class="flex align-center"> + <span>{{ partial "docs/title" . }}</span> + <img src="{{ "svg/forward.svg" | relURL }}" class="book-icon" alt="Next" title="{{ partial "docs/title" . }}" /> + </a> + {{ end }} + </span> + </div> + {{ end -}} +{{ end }} |
