| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Servant.Seo.UI
Synopsis
- type RobotsAPI = "robots.txt" :> Get '[PlainText] Text
- apiWithRobots :: forall (api :: *). (HasServer api '[], HasRobots api) => Proxy api -> Proxy (RobotsAPI :<|> api)
- serveWithRobots :: forall (api :: *). (HasServer api '[], HasRobots api) => ServerUrl -> Proxy api -> Server api -> Application
- serveRobots :: ServerUrl -> RobotsInfo -> Handler Text
- type SitemapAPI = ("sitemap.xml" :> Get '[XML] ByteString) :<|> ("sitemap" :> (Capture ":sitemap" SitemapIx :> ("sitemap.xml" :> Get '[XML] ByteString)))
- apiWithSitemap :: forall (api :: *). (HasServer api '[], HasSitemap api) => Proxy api -> Proxy (SitemapAPI :<|> api)
- serveWithSitemap :: forall (api :: *). (HasServer api '[], HasSitemap api) => ServerUrl -> Proxy api -> Server api -> Application
- sitemapServer :: forall (api :: *). (HasServer api '[], HasSitemap api) => ServerUrl -> Proxy api -> Server SitemapAPI
- serveSitemap :: forall (api :: *). (HasServer api '[], HasSitemap api) => ServerUrl -> Proxy api -> Handler ByteString
- serveNestedSitemap :: forall (api :: *). (HasServer api '[], HasSitemap api) => ServerUrl -> Proxy api -> SitemapIx -> Handler ByteString
- serveWithSeo :: forall (api :: *). (HasServer api '[], HasRobots api, HasSitemap api) => ServerUrl -> Proxy api -> Server api -> Application
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.