{{ $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 }}