Popularity
3.4
Growing
Activity
5.6
Declining
3
2
0

Monthly Downloads: 55
Programming language: Haskell
License: BSD 3-clause "New" or "Revised" License
Tags: Web     Sitemap    
Latest version: v0.1.0.0
Add another 'sitemap' Package

README

sitemap-gen

sitemap-gen Build Status

sitemap-gen is a Haskell library for generating XML sitemaps and sitemap index files.

It uses the xmlgen library to generate XML that conforms to the sitemaps.org XML schema.

To use this library, build a Sitemap or SitemapIndex type and use the respective render... functions to build the ByteString output:

import Web.Sitemap.Gen (Sitemap(..), SitemapUrl(..), renderSitemap)

import qualified Data.ByteString as BS
import qualified Web.Sitemap.Gen as Sitemap

mySitemap :: BS.ByteString
mySitemap =
    let urls =
            [ SitemapUrl
                { sitemapLocation = "https://mydomain.com/my/url/"
                , sitemapLastModified = Nothing
                , sitemapChangeFrequency = Just Sitemap.Monthly
                , sitemapPriority = Just 0.9
                }
            , SitemapUrl
                { sitemapLocation = "https://mydomain.com/lower/priority/"
                , sitemapLastModified = Nothing
                , sitemapChangeFrequency = Just Sitemap.Yearly
                , sitemapPriority = Just 0.4
                }
            ]
    in
    renderSitemap $ Sitemap urls

Develop

Build the package, documentation, & tests with stack:

stack build --pedantic --haddock --test --file-watch

License

BSD-3, exceptions possible.


*Note that all licence references and agreements mentioned in the sitemap-gen README section above are relevant to that project's source code only.