configuration of robots.txt via config/robots.txt

This commit is contained in:
Pascal Wittmann 2011-10-15 11:00:02 +02:00
parent 325d912be3
commit 0452ee4527
3 changed files with 7 additions and 2 deletions

View File

@ -5,10 +5,10 @@ module Yesod.Default.Handlers
) where
import Yesod.Handler (GHandler, sendFile)
import Yesod.Content (RepPlain(..), ToContent(..))
import Yesod.Content (RepPlain(..))
getFaviconR :: GHandler s m ()
getFaviconR = sendFile "image/x-icon" "config/favicon.ico"
getRobotsR :: GHandler s m RepPlain
getRobotsR = return $ RepPlain $ toContent ("User-agent: *" :: String)
getRobotsR = sendFile "text/plain" "config/robots.txt"

View File

@ -189,5 +189,9 @@ scaffold = do
$(runIO (S.readFile "scaffold/config/favicon.ico.cg") >>= \bs -> do
pack <- [|S.pack|]
return $ pack `AppE` LitE (StringL $ S.unpack bs))
S.writeFile (dir ++ "/config/robots.txt")
$(runIO (S.readFile "scaffold/config/robots.txt.cg") >>= \bs -> do
[|S.pack $(return $ LitE $ StringL $ S.unpack bs)|])
puts $(codegenDir "input" "done")

View File

@ -0,0 +1 @@
User-agent: *