From 88c8a15be18a0bd1bd9b9cb175f7a68f2b9cd355 Mon Sep 17 00:00:00 2001 From: Mark Mandel Date: Wed, 26 Jun 2019 13:31:06 -0700 Subject: [PATCH] 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. --- tpl/tplimpl/embedded/templates/pagination.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tpl/tplimpl/embedded/templates/pagination.html b/tpl/tplimpl/embedded/templates/pagination.html index 1c2d2d82f..896e655fe 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 }}