Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prikhi/sitemap-gen
Generate XML Sitemaps & Sitemap Indexes.
https://github.com/prikhi/sitemap-gen
haskell library sitemap sitemap-generator sitemap-schema xml xml-sitemaps xmlgen
Last synced: 28 days ago
JSON representation
Generate XML Sitemaps & Sitemap Indexes.
- Host: GitHub
- URL: https://github.com/prikhi/sitemap-gen
- Owner: prikhi
- License: bsd-3-clause
- Created: 2020-01-19T02:05:43.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-08-17T22:41:48.000Z (about 2 years ago)
- Last Synced: 2024-04-25T22:30:35.324Z (7 months ago)
- Topics: haskell, library, sitemap, sitemap-generator, sitemap-schema, xml, xml-sitemaps, xmlgen
- Language: Haskell
- Homepage: https://hackage.haskell.org/package/sitemap-gen
- Size: 25.4 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# sitemap-gen
[![sitemap-gen Build Status](https://github.com/prikhi/sitemap-gen/actions/workflows/main.yml/badge.svg)](https://github.com/prikhi/sitemap-gen/actions/workflows/main.yml)
`sitemap-gen` is a Haskell library for generating XML sitemaps and sitemap
index files.It uses the [xmlgen][xmlgen] library to generate XML that conforms to the
[sitemaps.org][sitemap-schema] XML schema.To use this library, build a `Sitemap` or `SitemapIndex` type and use the
respective `render...` functions to build the `ByteString` output:```haskell
import Web.Sitemap.Gen (Sitemap(..), SitemapUrl(..), renderSitemap)import qualified Data.ByteString as BS
import qualified Web.Sitemap.Gen as SitemapmySitemap :: 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`:
```sh
stack build --pedantic --haddock --test --file-watch
```## License
BSD-3, exceptions possible.
[xmlgen]: https://hackage.haskell.org/package/xmlgen
[sitemap-schema]: https://www.sitemaps.org/protocol.html#index