Newer
Older
{{/* TODO: Create a generic previous / next section for single section */}}
{{ $previous_label := .previous_label | default (i18n "posts.previous") }}
{{ $next_label := .next_label | default (i18n "posts.next") }}
Alexis BENOIT
committed
{{ $reversed := .reversed | default false }}
Alexis BENOIT
committed
{{ $previous_content := .PrevInSection }}
{{ $next_content := .NextInSection }}
{{ if $reversed }}
{{ $previous_content = .NextInSection }}
{{ $next_content = .PrevInSection }}
{{ end }}
{{- if or .PrevInSection .NextInSection -}}
<div class="block block-siblings-navigation">
<div class="container">
<div class="block-content">
<nav class="siblings-navigation" aria-label="{{ i18n "commons.pagination.between.posts" }}">
<ul>
Alexis BENOIT
committed
{{ with $previous_content }}
<li class="previous">
{{ $title := partial "PrepareHTML" .Title -}}
<a href="{{.RelPermalink}}" title="{{ safeHTML (i18n "posts.previous_aria" (dict "Title" $title)) }}">
<span>
{{- $previous_label -}}
</span>
{{- $title -}}
</a>
</li>
{{ end }}
Alexis BENOIT
committed
{{ with $next_content }}
<li class="next">
{{ $title := partial "PrepareHTML" .Title -}}
<a href="{{.RelPermalink}}" title="{{ safeHTML (i18n "posts.next_aria" (dict "Title" $title)) }}">
<span>
{{- $next_label -}}
</span>
{{- $title -}}
</a>
</li>
{{ end }}