Only make the "prev" link in the second page when the second page actually exists
This commit is contained in:
parent
d6941823fd
commit
64a9830f6d
1 changed files with 2 additions and 2 deletions
|
@ -272,8 +272,8 @@
|
||||||
[{:keys [blog-prefix posts-per-page blocks-per-preview] :as params} posts]
|
[{:keys [blog-prefix posts-per-page blocks-per-preview] :as params} posts]
|
||||||
(when-not (empty? posts)
|
(when-not (empty? posts)
|
||||||
(let [previews (-> (create-previews posts-per-page blocks-per-preview posts)
|
(let [previews (-> (create-previews posts-per-page blocks-per-preview posts)
|
||||||
(create-preview-links blog-prefix)
|
(create-preview-links blog-prefix))
|
||||||
(assoc-in [1 :prev] (str blog-prefix "/index.html")))]
|
previews (if (> (count previews) 1) (assoc-in previews [1 :prev] (str blog-prefix "/index.html")) previews)]
|
||||||
(create-folder (str blog-prefix "/p/"))
|
(create-folder (str blog-prefix "/p/"))
|
||||||
(doseq [{:keys [index posts prev next]} previews]
|
(doseq [{:keys [index posts prev next]} previews]
|
||||||
(spit (if (= 1 index) (str public blog-prefix "/index.html") (str public blog-prefix "/p/" index))
|
(spit (if (= 1 index) (str public blog-prefix "/index.html") (str public blog-prefix "/p/" index))
|
||||||
|
|
Loading…
Reference in a new issue