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

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Please see the README on GitHub at https://github.com/swamp-agr/servant-seo#readme


[Skip to Readme]

Properties

Versions 0.1.0, 0.1.0, 0.1.1, 0.1.2
Change log ChangeLog.md
Dependencies aeson, base (>=4.7 && <5), binary, blaze-markup, bytestring, containers, http-media, lens (>=4.18.1), servant, servant-blaze, servant-server, text, warp, xml-conduit [details]
License BSD-3-Clause
Copyright Andrey Prokopenko (c) 2020
Author Andrey Prokopenko
Maintainer persiantiger@yandex.ru
Category Web, Servant
Home page https://github.com/swamp-agr/servant-seo#readme
Bug tracker https://github.com/swamp-agr/servant-seo/issues
Source repo head: git clone https://github.com/swamp-agr/servant-seo
Uploaded by swamp_agr at 2020-07-11T20:42:27Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for servant-seo-0.1.0

[back to package description]

servant-seo

Installation

Usage

  1. Restrict API with Disallow combinator to prevent robots making requests.
type ProtectedAPI = Disallow "admin" :> Get '[HTML] AdminPage

type StaticAPI = "cdn" :> Disallow "static" :> Raw
  1. Add Priority and Frequency (optional step).
typw BlogAPI = "blog" :> Frequency 'Always :> Get '[HTML] BlogPage
  1. Extend your API with something like:
Warp.runSettings Warp.defaultSettings $ serveWithSeo website api server
where
  website = "https://example.com"

You will have /robots.txt and /sitemap.xml automatically generated and ready to be served with your API.

See Servant.Seo module for detailed description and example/Example.hs for show case.

Acknowledgements

This library would not have happened without these people. Thank you!