vanilla-hugo/layouts/partials/serieslink.html
Danila Fedorin 00431109ac Improve the series navigation links
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2024-05-20 00:34:52 -07:00

17 lines
649 B
HTML

<div class="{{ .direction }} wrapper">
<a href="{{ .link }}">
{{ if eq .direction "previous" }}{{ partial "icon.html" "chevrons-left" }}{{ end }}
<div class="title-subtitle">
{{ title .direction }} in Series
{{ $divider := .term.Params.divider }}
{{ if (and $divider (strings.Contains .page.Title $divider)) }}
{{ $rest := after 1 (split .page.Title $divider) }}
<div class="title">{{ delimit $rest $divider }}</div>
{{ else }}
<div class="title">{{ .page.Title }}</div>
{{ end }}
</div>
{{ if eq .direction "next" }}{{ partial "icon.html" "chevrons-right" }}{{ end }}
</a>
</div>