Skip to content

Instantly share code, notes, and snippets.

@jirkapenzes
Created August 25, 2016 12:32
Show Gist options
  • Save jirkapenzes/7fdb5c076fb118074bba5c75cbc75025 to your computer and use it in GitHub Desktop.
Save jirkapenzes/7fdb5c076fb118074bba5c75cbc75025 to your computer and use it in GitHub Desktop.
(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)))
(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