|
| 1 | +{{ $items := slice |
| 2 | + (dict "title" "Gender explorer - filtered comparison" "url" "/visualizations/gender-explorer/") |
| 3 | + (dict "title" "The gender-genre scatter" "url" "/visualizations/gender-genre-scatter/") |
| 4 | + (dict "title" "Gender explorator" "url" "/visualizations/gender-explorator/") |
| 5 | + (dict "title" "Cartogram" "url" "/visualizations/cartogram/") |
| 6 | + (dict "title" "Bar race" "url" "/visualizations/bar-race/") |
| 7 | + (dict "title" "Languages" "url" "/visualizations/languages/") |
| 8 | + (dict "title" "Publishers" "url" "/visualizations/publishers/") |
| 9 | + (dict "title" "Library" "url" "/visualizations/library/") |
| 10 | +}} |
| 11 | + |
| 12 | +{{ $current := .RelPermalink }} |
| 13 | +{{ $currentIndex := -1 }} |
| 14 | +{{ range $index, $item := $items }} |
| 15 | + {{ if eq $current ($item.url | relURL) }} |
| 16 | + {{ $currentIndex = $index }} |
| 17 | + {{ end }} |
| 18 | +{{ end }} |
| 19 | + |
| 20 | +{{ if ge $currentIndex 0 }} |
| 21 | + {{ $lastIndex := sub (len $items) 1 }} |
| 22 | + {{ $home := dict "title" "Home" "url" "/" }} |
| 23 | + {{ $previous := cond (eq $currentIndex 0) $home (index $items (sub $currentIndex 1)) }} |
| 24 | + {{ $next := cond (eq $currentIndex $lastIndex) $home (index $items (add $currentIndex 1)) }} |
| 25 | + |
| 26 | + <nav class="not-prose mt-12 flex flex-wrap items-center justify-between gap-8 border-t border-neutral-200 pt-8 dark:border-neutral-700"> |
| 27 | + <a |
| 28 | + class="group inline-flex max-w-full items-center gap-4 text-neutral-700 transition hover:text-primary-700 dark:text-neutral-200 dark:hover:text-primary-300" |
| 29 | + href="{{ $previous.url | relURL }}" |
| 30 | + > |
| 31 | + <span class="text-5xl leading-none transition group-hover:-translate-x-1" aria-hidden="true">←</span> |
| 32 | + <span class="min-w-0"> |
| 33 | + <span class="block text-sm font-semibold uppercase tracking-wide text-neutral-500 dark:text-neutral-400">Back</span> |
| 34 | + <span class="block text-2xl font-bold leading-tight">{{ $previous.title }}</span> |
| 35 | + </span> |
| 36 | + </a> |
| 37 | + |
| 38 | + <a |
| 39 | + class="group inline-flex max-w-full items-center gap-4 text-right text-primary-800 transition hover:text-primary-950 dark:text-primary-200 dark:hover:text-primary-300" |
| 40 | + href="{{ $next.url | relURL }}" |
| 41 | + > |
| 42 | + <span class="min-w-0"> |
| 43 | + <span class="block text-sm font-semibold uppercase tracking-wide text-primary-600 dark:text-primary-300">Next</span> |
| 44 | + <span class="block text-2xl font-bold leading-tight">{{ $next.title }}</span> |
| 45 | + </span> |
| 46 | + <span class="text-5xl leading-none transition group-hover:translate-x-1" aria-hidden="true">→</span> |
| 47 | + </a> |
| 48 | + </nav> |
| 49 | +{{ end }} |
0 commit comments