add post url support to match the old wordpress style (trailing slash)

This commit is contained in:
Gered 2013-06-06 18:36:08 -04:00
parent 2013314043
commit f9e01cea1f

View file

@ -118,7 +118,11 @@
(defroutes posts-routes
(GET "/" [page] (list-page (parse-int page 0)))
(GET
["/:year/:month/:day/:slug" :year #"[0-9]{4}" :month #"[0-9]{1,2}" :day #"[0-9]{1,2}" :slug #"(.*)"]
["/:year/:month/:day/:slug/" :year #"[0-9]{4}" :month #"[0-9]{1,2}" :day #"[0-9]{1,2}" :slug #"(.*)"]
[year month day slug]
(show-post-page year month day slug))
(GET
["/:year/:month/:day/:slug" :year #"[0-9]{4}" :month #"[0-9]{1,2}" :day #"[0-9]{1,2}" :slug #"(.*)"]
[year month day slug]
(show-post-page year month day slug))
(GET "/tag/:tag" [tag] (list-by-tag tag))