summaryrefslogtreecommitdiff
path: root/themes/blowfish/layouts/partials/article-pagination.html
blob: bb2fe79dd5a0764e8e763ce4fe71c3c8f2c14c12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{{ if .Params.showPagination | default (.Site.Params.article.showPagination | default true) }}
  {{ if or .NextInSection .PrevInSection }}
    {{ $next := .NextInSection }}
    {{ $prev := .PrevInSection }}
    {{ if .Params.invertPagination | default (.Site.Params.article.invertPagination | default false) }}
      {{ $next = .PrevInSection }}
      {{ $prev = .NextInSection }}
    {{ end }}
    <div class="pt-8">
      <hr class="border-dotted border-neutral-300 dark:border-neutral-600" />
      <div class="flex justify-between pt-3">
        <span>
          {{ if $prev }}
            <a class="flex group mr-3" href="{{ $prev.RelPermalink }}">
              <span
                class="mr-3 text-neutral-700 group-hover:text-primary-600 ltr:inline rtl:hidden dark:text-neutral dark:group-hover:text-primary-400"
                >&larr;</span
              >
              <span
                class="ml-3 text-neutral-700 group-hover:text-primary-600 ltr:hidden rtl:inline dark:text-neutral dark:group-hover:text-primary-400"
                >&rarr;</span
              >
              <span class="flex flex-col">
                <span
                  class="mt-[0.1rem] leading-6 group-hover:underline group-hover:decoration-primary-500"
                  >{{ $prev.Title | emojify }}</span
                >
                <span class="mt-[0.1rem] text-xs text-neutral-500 dark:text-neutral-400">
                  {{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }}
                    {{ partial "meta/date.html" $prev.Date }}
                  {{ end }}
                </span>
              </span>
            </a>
          {{ end }}
        </span>
        <span>
          {{ if $next }}
            <a class="flex text-right group ml-3" href="{{ $next.RelPermalink }}">
              <span class="flex flex-col">
                <span
                  class="mt-[0.1rem] leading-6 group-hover:underline group-hover:decoration-primary-500"
                  >{{ $next.Title | emojify }}</span
                >
                <span class="mt-[0.1rem] text-xs text-neutral-500 dark:text-neutral-400">
                  {{ if .Params.showDate | default (.Site.Params.article.showDate | default true) }}
                    {{ partial "meta/date.html" $next.Date }}
                  {{ end }}
                </span>
              </span>
              <span
                class="ml-3 text-neutral-700 group-hover:text-primary-600 ltr:inline rtl:hidden dark:text-neutral dark:group-hover:text-primary-400"
                >&rarr;</span
              >
              <span
                class="mr-3 text-neutral-700 group-hover:text-primary-600 ltr:hidden rtl:inline dark:text-neutral dark:group-hover:text-primary-400"
                >&larr;</span
              >
            </a>
          {{ end }}
        </span>
      </div>
    </div>
  {{ end }}
{{ end }}