removed the digest dependency; changes hash computation
This commit is contained in:
@@ -6,7 +6,6 @@
|
|||||||
[jayq "0.1.0-alpha2"]
|
[jayq "0.1.0-alpha2"]
|
||||||
[fetch "0.1.0-alpha2"]
|
[fetch "0.1.0-alpha2"]
|
||||||
[clj-redis "0.0.12"]
|
[clj-redis "0.0.12"]
|
||||||
[digest "1.4.0"]
|
|
||||||
[org.pegdown/pegdown "1.1.0"]
|
[org.pegdown/pegdown "1.1.0"]
|
||||||
[noir "1.3.0-beta1"]]
|
[noir "1.3.0-beta1"]]
|
||||||
:plugins [[lein-cljsbuild "0.1.10"]]
|
:plugins [[lein-cljsbuild "0.1.10"]]
|
||||||
|
|||||||
@@ -85,8 +85,7 @@
|
|||||||
:border-bottom [:1px :dashed :gray]
|
:border-bottom [:1px :dashed :gray]
|
||||||
:margin-bottom :5em)
|
:margin-bottom :5em)
|
||||||
(rule "h1, h2, h3, h4"
|
(rule "h1, h2, h3, h4"
|
||||||
:font-family (gen-comma-list
|
:font-family (gen-comma-list "'Noticia Text'" "Georgia"))))
|
||||||
"'Noticia Text'" "Georgia"))))
|
|
||||||
|
|
||||||
(defpartial layout [title & content]
|
(defpartial layout [title & content]
|
||||||
(html5
|
(html5
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
(ns NoteHub.views.pages
|
(ns NoteHub.views.pages
|
||||||
(:require [NoteHub.views.common :as common] [digest :as digest])
|
(:require [NoteHub.views.common :as common])
|
||||||
(:use
|
(:use
|
||||||
[NoteHub.storage :rename {get s-get set s-set} :only [set get]]
|
[NoteHub.storage :rename {get s-get set s-set} :only [set get]]
|
||||||
[noir.response :only [redirect]]
|
[noir.response :only [redirect]]
|
||||||
@@ -31,7 +31,10 @@
|
|||||||
[:article#preview.central-body]))
|
[:article#preview.central-body]))
|
||||||
|
|
||||||
(defn get-storage-key [year month day title]
|
(defn get-storage-key [year month day title]
|
||||||
(str "note-" (digest/md5 (str year month day title))))
|
(apply str (interpose "-" ["note" year month day (hash [year month day title])])))
|
||||||
|
|
||||||
|
(defremote md-to-html [draft]
|
||||||
|
(.markdownToHtml (PegDownProcessor.) draft))
|
||||||
|
|
||||||
(defpage "/:year/:month/:day/:title" {:keys [year month day title]}
|
(defpage "/:year/:month/:day/:title" {:keys [year month day title]}
|
||||||
(let [key (get-storage-key year month day title)
|
(let [key (get-storage-key year month day title)
|
||||||
@@ -54,6 +57,3 @@
|
|||||||
(do
|
(do
|
||||||
(s-set key draft)
|
(s-set key draft)
|
||||||
(redirect (apply str (interpose "/" ["" year month day title]))))))
|
(redirect (apply str (interpose "/" ["" year month day title]))))))
|
||||||
|
|
||||||
(defremote md-to-html [draft]
|
|
||||||
(.markdownToHtml (PegDownProcessor.) draft))
|
|
||||||
|
|||||||
Reference in New Issue
Block a user