sitemap-gen: Generate XML Sitemaps & Sitemap Indexes

[ bsd3, library, web ] [ Propose Tags ]

The sitemap-gen package uses the xmlgen package to generate XML sitemaps that are compliant with the sitemaps.org XML schema.

See the Web.Sitemap.Gen module and the README file for documentation & usage details.


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0
Change log CHANGELOG.md
Dependencies base (>=4.7 && <5), text (>=1 && <3), time (>=1.6 && <2), xmlgen (>=0.6 && <1) [details]
License BSD-3-Clause
Copyright 2019 Pavan Rikhi
Author Pavan Rikhi
Maintainer pavan.rikhi@gmail.com
Revised Revision 1 made by lysergia at 2022-08-17T22:43:00Z
Category Web
Home page https://github.com/prikhi/sitemap-gen#readme
Bug tracker https://github.com/prikhi/sitemap-gen/issues
Source repo head: git clone https://github.com/prikhi/sitemap-gen
Uploaded by lysergia at 2020-01-19T06:12:36Z
Distributions LTSHaskell:0.1.0.0, NixOS:0.1.0.0, Stackage:0.1.0.0
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 760 total (16 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2020-01-19 [all 1 reports]

Readme for sitemap-gen-0.1.0.0

[back to package description]

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

License

BSD-3, exceptions possible.