configuration of robots.txt via config/robots.txt
This commit is contained in:
parent
325d912be3
commit
0452ee4527
@ -5,10 +5,10 @@ module Yesod.Default.Handlers
|
|||||||
) where
|
) where
|
||||||
|
|
||||||
import Yesod.Handler (GHandler, sendFile)
|
import Yesod.Handler (GHandler, sendFile)
|
||||||
import Yesod.Content (RepPlain(..), ToContent(..))
|
import Yesod.Content (RepPlain(..))
|
||||||
|
|
||||||
getFaviconR :: GHandler s m ()
|
getFaviconR :: GHandler s m ()
|
||||||
getFaviconR = sendFile "image/x-icon" "config/favicon.ico"
|
getFaviconR = sendFile "image/x-icon" "config/favicon.ico"
|
||||||
|
|
||||||
getRobotsR :: GHandler s m RepPlain
|
getRobotsR :: GHandler s m RepPlain
|
||||||
getRobotsR = return $ RepPlain $ toContent ("User-agent: *" :: String)
|
getRobotsR = sendFile "text/plain" "config/robots.txt"
|
||||||
|
|||||||
@ -189,5 +189,9 @@ scaffold = do
|
|||||||
$(runIO (S.readFile "scaffold/config/favicon.ico.cg") >>= \bs -> do
|
$(runIO (S.readFile "scaffold/config/favicon.ico.cg") >>= \bs -> do
|
||||||
pack <- [|S.pack|]
|
pack <- [|S.pack|]
|
||||||
return $ pack `AppE` LitE (StringL $ S.unpack bs))
|
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")
|
puts $(codegenDir "input" "done")
|
||||||
|
|||||||
1
yesod/scaffold/config/robots.txt.cg
Normal file
1
yesod/scaffold/config/robots.txt.cg
Normal file
@ -0,0 +1 @@
|
|||||||
|
User-agent: *
|
||||||
Loading…
Reference in New Issue
Block a user