hugo-book-theme/layouts/partials/docs/prev-next.html

28 lines
1,003 B
HTML
Raw Normal View History

{{ $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">
{{ with $prev }}
<a href="{{ .RelPermalink }}" class="flex align-center float-left book-icon">
<img src="{{ "svg/backward.svg" | relURL }}" alt="Previous" title="{{ partial "docs/title" . }}" />
<span>{{ partial "docs/title" . }}</span>
</a>
{{ end }}
{{ with $next }}
<a href="{{ .RelPermalink }}" class="flex align-center float-right book-icon">
<span>{{ partial "docs/title" . }}</span>
<img src="{{ "svg/forward.svg" | relURL }}" alt="Next" title="{{ partial "docs/title" . }}" />
</a>
{{ end }}
</div>
{{ end -}}
{{ end }}