Skip to content
Snippets Groups Projects
Unverified Commit 0f1f3ec9 authored by Alexis BENOIT's avatar Alexis BENOIT Committed by GitHub
Browse files

Ajout d'une option d'inversement de la navigation précédente / suivante (#476)

parent 0208fffe
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,7 @@
"context" .
"previous_label" (i18n "events.previous")
"next_label" (i18n "events.next")
"reversed" (not .Params.dates.archive)
) }}
{{ partial "hooks/before-document-content-end.html" . }}
......
{{/* 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") }}
{{ $reversed := .reversed | default false }}
{{ with .context }}
{{ $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>
{{ with .PrevInSection }}
{{ with $previous_content }}
<li class="previous">
{{ $title := partial "PrepareHTML" .Title -}}
<a href="{{.RelPermalink}}" title="{{ safeHTML (i18n "posts.previous_aria" (dict "Title" $title)) }}">
......@@ -20,7 +29,7 @@
</a>
</li>
{{ end }}
{{ with .NextInSection }}
{{ with $next_content }}
<li class="next">
{{ $title := partial "PrepareHTML" .Title -}}
<a href="{{.RelPermalink}}" title="{{ safeHTML (i18n "posts.next_aria" (dict "Title" $title)) }}">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment