servant-seo-0.1.0: Generate Robots.txt and Sitemap.xml specification for your servant API.

Safe HaskellNone
LanguageHaskell2010

Servant.Seo.UI

Contents

Synopsis

robots.txt

type RobotsAPI = "robots.txt" :> Get '[PlainText] Text Source #

Robots API. Provides /robots.txt.

apiWithRobots :: forall (api :: *). (HasServer api '[], HasRobots api) => Proxy api -> Proxy (RobotsAPI :<|> api) Source #

Extends API with RobotsAPI.

serveWithRobots :: forall (api :: *). (HasServer api '[], HasRobots api) => ServerUrl -> Proxy api -> Server api -> Application Source #

Provides "wrapper" around API. Both API and corresponding Server wrapped with RobotsAPI and serveRobots handler.

serveRobots :: ServerUrl -> RobotsInfo -> Handler Text Source #

Handler for RobotsAPI.

sitemap.xml

type SitemapAPI = ("sitemap.xml" :> Get '[XML] ByteString) :<|> ("sitemap" :> (Capture ":sitemap" SitemapIx :> ("sitemap.xml" :> Get '[XML] ByteString))) Source #

Sitemap API. Provides both single /sitemap.xml and /sitemap/:sitemap/sitemap.xml in case of indexing. If sitemap consists of more than 50000 URLs /sitemap.xml would return list of indeces to nested sitemaps.

apiWithSitemap :: forall (api :: *). (HasServer api '[], HasSitemap api) => Proxy api -> Proxy (SitemapAPI :<|> api) Source #

Extends API with SitemapAPI.

serveWithSitemap :: forall (api :: *). (HasServer api '[], HasSitemap api) => ServerUrl -> Proxy api -> Server api -> Application Source #

Provides "wrapper" around API. Both API and corresponding Server wrapped with SitemapAPI and serveSitemap handler.

sitemapServer :: forall (api :: *). (HasServer api '[], HasSitemap api) => ServerUrl -> Proxy api -> Server SitemapAPI Source #

Server implementation for sitemap.xml and indexed sitemaps (if present).

serveSitemap :: forall (api :: *). (HasServer api '[], HasSitemap api) => ServerUrl -> Proxy api -> Handler ByteString Source #

Provides implementation for sitemap.xml.

serveNestedSitemap :: forall (api :: *). (HasServer api '[], HasSitemap api) => ServerUrl -> Proxy api -> SitemapIx -> Handler ByteString Source #

Provides implementation for nested sitemaps.

Both robots.txt and sitemap.xml

serveWithSeo :: forall (api :: *). (HasServer api '[], HasRobots api, HasSitemap api) => ServerUrl -> Proxy api -> Server api -> Application Source #

Useful wrapper to extend API with both robots.txt and sitemap.xml.