Add support for generating an XML sitemap
This commit is contained in:
parent
1c5939d863
commit
8c3a562c7d
4 changed files with 16 additions and 3 deletions
src/Handler
|
@ -7,6 +7,8 @@
|
|||
module Handler.Common where
|
||||
|
||||
import Data.FileEmbed (embedFile)
|
||||
import Yesod.Sitemap
|
||||
|
||||
import Import
|
||||
|
||||
-- These handlers embed files in the executable at compile time to avoid a
|
||||
|
@ -21,6 +23,14 @@ getKeybaseR :: Handler TypedContent
|
|||
getKeybaseR = return $ TypedContent typePlain
|
||||
$ toContent $(embedFile "config/keybase.txt")
|
||||
|
||||
getRobotsR :: Handler TypedContent
|
||||
getRobotsR = return $ TypedContent typePlain
|
||||
$ toContent $(embedFile "config/robots.txt")
|
||||
getRobotsR :: Handler Text
|
||||
getRobotsR = robots SitemapR
|
||||
|
||||
getSitemapR :: Handler TypedContent
|
||||
getSitemapR = sitemap $ do
|
||||
yield SitemapUrl
|
||||
{ sitemapLoc = HomeR
|
||||
, sitemapLastMod = Nothing
|
||||
, sitemapChangeFreq = Just Daily
|
||||
, sitemapPriority = Nothing
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue