From 96a07bc5802b693101f3f75c9e14db98c316463f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 13 Mar 2013 09:37:28 -0700 Subject: [PATCH] Avoid conflict with getRobotsR and getFaviconR when subsite. Previously gitit2 didn't work well as a subsite when the main site defined getRobotsR or getFaviconR, since it exported these itself. Now it exports getGititRobotsR and getGititFaviconR instead, so there is no conflict. Closes #3, I believe. --- Network/Gitit2.hs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Network/Gitit2.hs b/Network/Gitit2.hs index 9094db9..f4a87f5 100644 --- a/Network/Gitit2.hs +++ b/Network/Gitit2.hs @@ -60,7 +60,7 @@ import Control.Exception (throw, handle, try) import Text.Highlighting.Kate import Data.Time (getCurrentTime, addUTCTime) import Yesod.AtomFeed -import Yesod.Default.Handlers (getFaviconR, getRobotsR) +import Yesod.Default.Handlers (getRobotsR, getFaviconR) import Data.Yaml import System.Directory import System.Time (ClockTime (..), getClockTime) @@ -231,8 +231,8 @@ mkYesodSub "Gitit" [ ClassP ''HasGitit [VarT $ mkName "master"] /_static StaticR Static getStatic /_index IndexBaseR GET /_index/*Page IndexR GET -/favicon.ico FaviconR GET -/robots.txt RobotsR GET +/favicon.ico GititFaviconR GET +/robots.txt GititRobotsR GET /_random RandomR GET /_raw/*Page RawR GET /_edit/*Page EditR GET @@ -434,6 +434,12 @@ isSourceFile path' = do return $ not (null langs || takeExtension path' == ".svg") -- allow svg to be served as image +getGititRobotsR :: GH m RepPlain +getGititRobotsR = getRobotsR + +getGititFaviconR :: GH m () +getGititFaviconR = getFaviconR + getHomeR :: HasGitit master => GH master RepHtml getHomeR = do conf <- getConfig