Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix broken post page after comment

  • Loading branch information...
commit 689ae54cfcf094a7fab14b5b522d00368f9138ca 1 parent f6493c3
@gregorycollins authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/Homepage/Handlers.hs
View
9 src/Homepage/Handlers.hs
@@ -6,6 +6,7 @@ module Homepage.Handlers (topLevelHandler) where
import Control.Monad.State.Strict
+import Data.List
import Data.Monoid
import qualified Data.ByteString.Lazy.Char8 as B
@@ -72,10 +73,16 @@ temporaryPosts = do
\website.")
, ("postDate", "march 28, 2009") ]
- dir "/posts/2009/03/28/building-a-website-part-1" $
+ prefixdir "/posts/2009/03/28/building-a-website-part-1" $
serveTemplate' "." "post" (setManyAttrib attrs)
+prefixdir :: (Monad m) => String -> ServerPartT m a -> ServerPartT m a
+prefixdir staticPath sps = do
+ rq <- askRq
+ if staticPath `isPrefixOf` (rqURL rq) then sps else mzero
+
+
fourohfour :: HomepageHandler
fourohfour = serveTemplate' "." "404" (setAttribute "whichCss"
("posts" :: String))

0 comments on commit 689ae54

Please sign in to comment.
Something went wrong with that request. Please try again.