Added Approot newtype
This commit is contained in:
parent
0fcfa1b9d8
commit
2eb6f2f05b
@ -17,6 +17,7 @@ module Yesod.Definitions
|
||||
( Verb (..)
|
||||
, toVerb
|
||||
, Resource
|
||||
, Approot (..)
|
||||
) where
|
||||
|
||||
import qualified Hack
|
||||
@ -31,3 +32,8 @@ toVerb Hack.POST = Post
|
||||
toVerb _ = Get
|
||||
|
||||
type Resource = [String]
|
||||
|
||||
-- | An absolute URL to the base of this application. This can almost be done
|
||||
-- programatically, but due to ambiguities in different ways of doing URL
|
||||
-- rewriting for (fast)cgi applications, it should be supplied by the user.
|
||||
newtype Approot = Approot { unApproot :: String }
|
||||
|
||||
@ -22,6 +22,7 @@ module Yesod.Helpers.Sitemap
|
||||
, SitemapChangeFreq (..)
|
||||
) where
|
||||
|
||||
import Yesod.Definitions
|
||||
import Yesod.Handler
|
||||
import Yesod.Response
|
||||
import Web.Encodings
|
||||
@ -92,7 +93,6 @@ sitemap urls' = do
|
||||
urls <- liftIO urls'
|
||||
return $ reps $ SitemapResponse req urls
|
||||
|
||||
robots :: Handler
|
||||
robots = do
|
||||
ar <- approot
|
||||
robots :: Approot -> Handler
|
||||
robots (Approot ar) = do
|
||||
return $ genResponse "text/plain" $ "Sitemap: " ++ ar ++ "sitemap.xml"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user