diff --git a/project.clj b/project.clj index fa56baf..5668152 100644 --- a/project.clj +++ b/project.clj @@ -38,9 +38,6 @@ :resource-paths ["resources"] :target-path "target/%s/" :main ^:skip-aot shapey-shifty.core - - :plugins [[lein-cljfmt "0.6.6"]] - :profiles {:uberjar {:omit-source true :aot :all @@ -57,6 +54,7 @@ [ring/ring-devel "1.8.0"] [ring/ring-mock "0.4.0"]] :plugins [[com.jakemccrary/lein-test-refresh "0.24.1"] + [lein-cljfmt "0.6.6"] [jonase/eastwood "0.3.5"]] :source-paths ["env/dev/clj"] diff --git a/src/clj/shapey_shifty/posts/posts_io.clj b/src/clj/shapey_shifty/posts/posts_io.clj index 7038762..f063d55 100644 --- a/src/clj/shapey_shifty/posts/posts_io.clj +++ b/src/clj/shapey_shifty/posts/posts_io.clj @@ -37,6 +37,15 @@ card (get author :card)] (assoc post :author card))) +(defn read-post + ([file] + (when (.exists file) + (-> file slurp edn/read-string assoc-author))) + ([dt-path n] + (let [path (format "%s/%s/%d/%s" base-posts-path (pathmap-to-path dt-path) n post-filename) + f (io/file path)] + (read-post f)))) + (defn read-all-posts ([] (read-all-posts base-posts-path)) @@ -46,12 +55,3 @@ file-seq (filter #(.isFile %)) (map #(read-post %))))) - -(defn read-post - ([file] - (when (.exists file) - (-> file slurp edn/read-string assoc-author))) - ([dt-path n] - (let [path (format "%s/%s/%d/%s" base-posts-path (pathmap-to-path dt-path) n post-filename) - f (io/file path)] - (read-post f))))