From 9b5f3fad7068298265dbbc8a65077f7917a090a5 Mon Sep 17 00:00:00 2001 From: aethrvmn Date: Sun, 21 Sep 2025 00:27:35 +0200 Subject: updated hugo-book theme --- .../layouts/_partials/docs/prev-next.html | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 themes/hugo-book/layouts/_partials/docs/prev-next.html (limited to 'themes/hugo-book/layouts/_partials/docs/prev-next.html') 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 }} +
+ + {{ with $prev }} + + Previous + {{ partial "docs/title" . }} + + {{ end }} + + + {{ with $next }} + + {{ partial "docs/title" . }} + Next + + {{ end }} + +
+ {{ end -}} +{{ end }} -- cgit v1.2.3