bugfix: noir doesn't respect the routes order

This commit is contained in:
Christian Mueller
2012-06-24 08:35:50 +02:00
parent 8e6972c048
commit abc04e122f
2 changed files with 4 additions and 7 deletions
+2 -2
View File
@@ -33,11 +33,11 @@ and for the text itself:
notehub.org/.../title?header-font=FONT-NAME&text-font=FONT-NAME2 notehub.org/.../title?header-font=FONT-NAME&text-font=FONT-NAME2
See an example of the font formatting ([here](http://notehub.org/2012/6/16/how-notehub-is-built?header-font=Berkshire+Swash&text-font=Swanky+and+Moo+Moo)). See an example of the font formatting [here](http://notehub.org/2012/6/16/how-notehub-is-built?header-font=Berkshire+Swash&text-font=Swanky+and+Moo+Moo).
After you've specified this in the url, you can copy the corresponding short url of the article and share it. After you've specified this in the url, you can copy the corresponding short url of the article and share it.
## Exporting & Statistics ## Export & Statistics
By appending of `/stat` to any note url, everyone can see a rudimentary statistics (currently, the number of note views only). By appending of `/stat` to any note url, everyone can see a rudimentary statistics (currently, the number of note views only).
By appending of `/export`, the original markdown content will be displayed in plain text format. By appending of `/export`, the original markdown content will be displayed in plain text format.
+2 -5
View File
@@ -13,7 +13,7 @@
[hiccup.core] [hiccup.core]
[hiccup.element] [hiccup.element]
[noir.response :only [redirect status content-type]] [noir.response :only [redirect status content-type]]
[noir.core :only [defpage render]] [noir.core :only [defpage pre-route]]
[cheshire.core] [cheshire.core]
[noir.statuses]) [noir.statuses])
(:import (:import
@@ -87,7 +87,7 @@
[:div.centered.helvetica-neue (md-to-html (get-message :created-by))])) [:div.centered.helvetica-neue (md-to-html (get-message :created-by))]))
; New Note Page ; New Note Page
(defpage "/new" {} (pre-route "/new" {}
(layout {:js true} (get-message :new-note) (layout {:js true} (get-message :new-note)
[:div.central-element [:div.central-element
(form-to [:post "/post-note"] (form-to [:post "/post-note"]
@@ -115,9 +115,6 @@
(let [md-text (get-note [year month day] title)] (let [md-text (get-note [year month day] title)]
(if md-text (content-type "text/plain; charset=utf-8" md-text) (response 404)))) (if md-text (content-type "text/plain; charset=utf-8" md-text) (response 404))))
(defpage "/:year/:month/:day/:title/short-url" params
(layout (get-message :short-url) (url (create-short-url params))))
; Provides the number of views of the specified note ; Provides the number of views of the specified note
(defpage "/:year/:month/:day/:title/stats" {:keys [year month day title]} (defpage "/:year/:month/:day/:title/stats" {:keys [year month day title]}
(let [views (get-note-views [year month day] title)] (let [views (get-note-views [year month day] title)]