From: Mark Mandel Date: Wed, 26 Jun 2019 20:31:06 +0000 (-0700) Subject: Pagination - do not render href if no next item X-Git-Tag: v0.56.0~29 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=88c8a15be;p=brevno-suite%2Fhugo Pagination - do not render href if no next item When using a html link checker with Hugo, this template consistently causes errors, as it renders `href=""` attributes when next/previous is disabled. This change makes it so that the `href` attribute is not rendered at all if `HasNext` is false - which is better semantically, and makes link checking far easier. --- diff --git a/tpl/tplimpl/embedded/templates/pagination.html b/tpl/tplimpl/embedded/templates/pagination.html index 1c2d2d82..896e655f 100644 --- a/tpl/tplimpl/embedded/templates/pagination.html +++ b/tpl/tplimpl/embedded/templates/pagination.html @@ -7,7 +7,7 @@ {{ end }}
  • - +
  • {{ $ellipsed := false }} {{ $shouldEllipse := false }} @@ -29,7 +29,7 @@ {{ end }} {{ end }}
  • - +
  • {{ with $pag.Last }}
  • @@ -37,4 +37,4 @@
  • {{ end }} -{{ end }} \ No newline at end of file +{{ end }}