summaryrefslogtreecommitdiffhomepage
path: root/themes/gohugoioTheme/layouts/partials/previous-next-links.html
blob: 0de521527bd8d351690c4be88a2147171e8bd101 (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
{{if .Prev }}
  <a href="{{ .Prev.Permalink }}" class="db-l f4 f3-ns link primary-color hover-black fw8">
    <span class="v-mid dib">{{ partial "svg/ic_chevron_left_black_24px.svg" (dict "size" "30px") }}</span> {{ .Prev.Title }}
  </a>
{{end}}

{{if .Next }}
  <a href="{{.Next.Permalink }}" class="db-l f4 f3-ns link primary-color hover-black fw8">
    {{ .Next.Title }} <span class="v-mid dib">{{ partial "svg/ic_chevron_right_black_24px.svg" (dict "size" "30px") }}</span>
  </a>
{{end}}


<script>
  document.body.onkeyup = function(e){

    {{ if .Prev }}
      if (e.keyCode == '37') { window.location = '{{ .Prev.Permalink }}'; }
    {{ end }}
    {{ if .Next }}
      if (e.keyCode == '39') { window.location = '{{.Next.Permalink }}'; }
    {{ end }}
  };

</script>