WebLS
A Gleam library for generating sitemaps and RSS feeds and more. to meet all your common web listing needs.
gleam add webls
import gleam/option.{None}
import webls/sitemap.{Sitemap}
pub fn sitemap() -> String {
let sitemap =
Sitemap(url: "https://gleam.run/sitemap.xml", last_modified: None, items: [
sitemap.item("https://gleam.run")
|> sitemap.with_frequency(sitemap.Monthly)
|> sitemap.with_priority(1.0),
sitemap.item("https://gleam.run/blog")
|> sitemap.with_frequency(sitemap.Weekly),
sitemap.item("https://gleam.run/blog/gleam-1.0"),
sitemap.item("https://gleam.run/blog/gleam-1.1"),
])
sitemap |> sitemap.to_string()
}
Further documentation can be found at https://hexdocs.pm/webls.
Current Standards Compliance
Protocol | Version | Status |
---|---|---|
Sitemaps | 0.9 | Complete |
RSS v2.0 | 2.0.1 | Partial |
Robots.txt | 1997 IDS | Complete |
Utility Support
Type | to_string | Builder Functions | Validators |
---|---|---|---|
Sitemap | Complete | Complete | None |
RSS v2.0 | Complete | None | None |
Robots.txt | Complete | Complete | None |
Development
gleam run # Run the project
gleam test # Run the tests
Yes the name is a reference to the
ls
command in unix to list files