diff --git a/README.md b/README.md index d468481..d551d12 100644 --- a/README.md +++ b/README.md @@ -33,11 +33,11 @@ and for the text itself: 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. -## 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 `/export`, the original markdown content will be displayed in plain text format. diff --git a/src/NoteHub/views/pages.clj b/src/NoteHub/views/pages.clj index 9a57243..ca77655 100644 --- a/src/NoteHub/views/pages.clj +++ b/src/NoteHub/views/pages.clj @@ -13,7 +13,7 @@ [hiccup.core] [hiccup.element] [noir.response :only [redirect status content-type]] - [noir.core :only [defpage render]] + [noir.core :only [defpage pre-route]] [cheshire.core] [noir.statuses]) (:import @@ -87,7 +87,7 @@ [:div.centered.helvetica-neue (md-to-html (get-message :created-by))])) ; New Note Page -(defpage "/new" {} +(pre-route "/new" {} (layout {:js true} (get-message :new-note) [:div.central-element (form-to [:post "/post-note"] @@ -115,9 +115,6 @@ (let [md-text (get-note [year month day] title)] (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 (defpage "/:year/:month/:day/:title/stats" {:keys [year month day title]} (let [views (get-note-views [year month day] title)]