Skip to content

Commit

Permalink
Avoid conflict with getRobotsR and getFaviconR when subsite.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
John MacFarlane committed Mar 13, 2013
1 parent b6aa254 commit 96a07bc
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Network/Gitit2.hs
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 96a07bc

Please sign in to comment.