Add the lazy loading for articles on the index page.
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
id (.-id (.-params req))]
|
||||
(go
|
||||
(try
|
||||
(let [articles (<! (db/get-articles client channel))]
|
||||
(let [articles (<! (db/get-articles-briefly client channel))]
|
||||
(res/status 200)
|
||||
(.render res "index"
|
||||
(-> {:articles articles}
|
||||
@@ -49,7 +49,7 @@
|
||||
(res/send (ex-message "404")))
|
||||
(do
|
||||
(res/status 200)
|
||||
(.render res "article_briefly"
|
||||
(.render res "article_full"
|
||||
(-> {:article article :layout false}
|
||||
(cljs.core/clj->js))))))
|
||||
(catch js/Error err
|
||||
|
||||
@@ -4,8 +4,10 @@
|
||||
(defn truncatestring-factory
|
||||
[]
|
||||
(fn [text limit]
|
||||
(-> (. text substring 0 limit)
|
||||
(str "..."))))
|
||||
(if (> (. text -length) limit)
|
||||
(-> (. text substring 0 limit)
|
||||
(str "..."))
|
||||
text)))
|
||||
|
||||
(defn full-timestamp-factory
|
||||
[]
|
||||
|
||||
Reference in New Issue
Block a user