hugo

Fork of github.com/gohugoio/hugo with reverse pagination support

git clone git://git.shimmy1996.com/hugo.git

previous-next-links.html (853B)

    1 {{if .Prev }}
    2   <a href="{{ .Prev.Permalink }}" class="db-l f4 f3-ns link primary-color hover-black fw8 mr4">
    3     <span class="v-mid dib">{{ partial "svg/ic_chevron_left_black_24px.svg" (dict "size" "30px") }}</span> {{ .Prev.Title }}
    4   </a>
    5 {{end}}
    6 
    7 {{if .Next }}
    8   <a href="{{.Next.Permalink }}" class="db-l f4 f3-ns link primary-color hover-black fw8">
    9     {{ .Next.Title }} <span class="v-mid dib">{{ partial "svg/ic_chevron_right_black_24px.svg" (dict "size" "30px") }}</span>
   10   </a>
   11 {{end}}
   12 
   13 
   14 <script>
   15   document.body.onkeyup = function(e){
   16     if (!(e.ctrlKey || e.shiftKey || e.altKey || e.metaKey)) {
   17     {{- if .Prev }}
   18       if (e.keyCode == '37') { window.location = '{{ .Prev.Permalink }}'; }
   19     {{- end }}
   20     {{- if .Next }}
   21       if (e.keyCode == '39') { window.location = '{{ .Next.Permalink }}'; }
   22     {{- end }}
   23     }
   24   };
   25 </script>