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

[ bsd3, library, servant, web ] [ Propose Tags ]

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


[Skip to Readme]
Versions [faq] 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 (>=0.16), 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-15T21:14:57Z
Distributions
Downloads 125 total (125 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs uploaded by user
Build status unknown [no reports yet]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for servant-seo-0.1.2

[back to package description]

servant-seo

Build Status

Hackage Status

Installation

  • Add servant-seo to project dependencies.

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
    
  2. Add Priority and Frequency (optional step).

    typw BlogAPI = "blog" :> Frequency 'Always :> Get '[HTML] BlogPage
    
  3. 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!

  • @fizruk and Servant Contributors: as source of inspiration.
  • @isovector: for Thinking with types book.