Commit 026b2ade authored by Phil Hofmann's avatar Phil Hofmann

Merge branch 'fix/show-pagination-only-when-applicable' into 'master'

fix: Show pagination only when applicable

See merge request !131
parents ff61efe7 644248a6
Pipeline #5139 passed with stage
in 1 minute and 55 seconds
......@@ -197,22 +197,23 @@
;; `:last-page` isn't set. For all actually
;; rendered pages is is, though.
0)]
[:div#pagination
(if-not (= (:page page) 1)
[:a.pager {:href (:first-page page)}
"<<"])
(if (:prev-page page)
[:a.pager {:href (:prev-page page)}
"<"])
[:span#current-page.pager (str (:page page)
" / "
pages-count)]
(if (:next-page page)
[:a.pager {:href (:next-page page)}
">"])
(if (not (= (:page page) pages-count))
[:a.pager {:href (:last-page page)}
">>"])]))
(if (> pages-count 0)
[:div#pagination
(if-not (= (:page page) 1)
[:a.pager {:href (:first-page page)}
"<<"])
(if (:prev-page page)
[:a.pager {:href (:prev-page page)}
"<"])
[:span#current-page.pager (str (:page page)
" / "
pages-count)]
(if (:next-page page)
[:a.pager {:href (:next-page page)}
">"])
(if (not (= (:page page) pages-count))
[:a.pager {:href (:last-page page)}
">>"])])))
(defn render [{global-meta :meta posts :entries page :entry}]
(layout/blog global-meta
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment