Created
August 25, 2016 12:32
-
-
Save jirkapenzes/7fdb5c076fb118074bba5c75cbc75025 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn- load-post [file] | |
(try | |
(->> (slurp file) | |
(parser/parse) | |
(convert-date) | |
(split-tags) | |
(add-author) | |
(add-file-name (.getName file)) | |
(add-relative-url (.getName file)) | |
(add-absolute-url (.getName file)) | |
(published->bool) | |
(body->html)) | |
(catch Exception e (print e) nil))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn last-posts [] | |
(->> (posts/find-all) | |
(filter published?) | |
(sort-by :publish-date) | |
(reverse))) | |
(defn last-posts [] | |
(reverse | |
(sort-by :published-date | |
(filter published? (posts/find-all))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment