Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type RobotsAPI = "robots.txt" :> Get '[PlainText] Text
- apiWithRobots :: forall (api :: *) (context :: [*]). (HasServer api context, HasRobots api) => Proxy api -> Context context -> Proxy (RobotsAPI :<|> api)
- serveWithRobots :: forall (api :: *) (context :: [*]). (HasServer api context, HasRobots api) => ServerUrl -> Proxy api -> Context context -> 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 :: *) (context :: [*]). (HasServer api context, HasSitemap api) => Proxy api -> Context context -> Proxy (SitemapAPI :<|> api)
- serveWithSitemap :: forall (api :: *) (context :: [*]). (HasServer api context, HasSitemap api) => ServerUrl -> Proxy api -> Context context -> Server api -> Application
- sitemapServer :: forall (api :: *) (context :: [*]). (HasServer api context, HasSitemap api) => ServerUrl -> Proxy api -> Context context -> Server SitemapAPI
- serveSitemap :: forall (api :: *) (context :: [*]). (HasServer api context, HasSitemap api) => ServerUrl -> Proxy api -> Context context -> Handler ByteString
- serveNestedSitemap :: forall (api :: *) (context :: [*]). (HasServer api context, HasSitemap api) => ServerUrl -> Proxy api -> Context context -> SitemapIx -> Handler ByteString
- serveWithSeo :: forall (api :: *) (context :: [*]). (HasServer api context, HasRobots api, HasSitemap api) => ServerUrl -> Proxy api -> Context context -> Server api -> Application
- serveWithSeo' :: forall (api :: *). (HasServer api '[], HasRobots api, HasSitemap api) => ServerUrl -> Proxy api -> Server api -> Application
robots.txt
apiWithRobots :: forall (api :: *) (context :: [*]). (HasServer api context, HasRobots api) => Proxy api -> Context context -> Proxy (RobotsAPI :<|> api) Source #
Extends API with RobotsAPI
.
serveWithRobots :: forall (api :: *) (context :: [*]). (HasServer api context, HasRobots api) => ServerUrl -> Proxy api -> Context context -> 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 :: *) (context :: [*]). (HasServer api context, HasSitemap api) => Proxy api -> Context context -> Proxy (SitemapAPI :<|> api) Source #
Extends API with SitemapAPI
.
serveWithSitemap :: forall (api :: *) (context :: [*]). (HasServer api context, HasSitemap api) => ServerUrl -> Proxy api -> Context context -> Server api -> Application Source #
Provides "wrapper" around API.
Both API and corresponding Server
wrapped with SitemapAPI
and serveSitemap
handler.
sitemapServer :: forall (api :: *) (context :: [*]). (HasServer api context, HasSitemap api) => ServerUrl -> Proxy api -> Context context -> Server SitemapAPI Source #
Server
implementation for sitemap.xml
and indexed sitemaps (if present).
serveSitemap :: forall (api :: *) (context :: [*]). (HasServer api context, HasSitemap api) => ServerUrl -> Proxy api -> Context context -> Handler ByteString Source #
Provides implementation for sitemap.xml
.
serveNestedSitemap :: forall (api :: *) (context :: [*]). (HasServer api context, HasSitemap api) => ServerUrl -> Proxy api -> Context context -> SitemapIx -> Handler ByteString Source #
Provides implementation for nested sitemaps.
Both robots.txt and sitemap.xml
serveWithSeo :: forall (api :: *) (context :: [*]). (HasServer api context, HasRobots api, HasSitemap api) => ServerUrl -> Proxy api -> Context context -> Server api -> Application Source #
Useful wrapper to extend API with both robots.txt
and sitemap.xml
with servant context.
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
without servant context.