Permalink
Browse files

Fix broken post page after comment

  • Loading branch information...
1 parent f6493c3 commit 689ae54cfcf094a7fab14b5b522d00368f9138ca @gregorycollins committed Mar 29, 2009
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/Homepage/Handlers.hs
View
@@ -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.