Add a 'name in series' helper to re-use logic
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
@@ -3,13 +3,9 @@
|
||||
{{ 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 }}
|
||||
{{ $scratch := newScratch -}}
|
||||
{{- partial "nameinseries.html" (dict "page" .page "scratch" $scratch) -}}
|
||||
<div class="title">{{ $scratch.Get "name" }}</div>
|
||||
</div>
|
||||
{{ if eq .direction "next" }}{{ partial "icon.html" "chevrons-right" }}{{ end }}
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user