A Gleam library for generating sitemaps and RSS feeds and more. to meet all your common web listing needs.
| 1 | gleam add webls |
| 1 | import gleam/option.{None} |
| 2 | import webls/sitemap.{Sitemap} |
| 3 | |
| 4 | pub fn sitemap() -> String { |
| 5 | let sitemap = |
| 6 | Sitemap(url: "https://gleam.run/sitemap.xml", last_modified: None, items: [ |
| 7 | sitemap.item("https://gleam.run") |
| 8 | |> sitemap.with_frequency(sitemap.Monthly) |
| 9 | |> sitemap.with_priority(1.0), |
| 10 | sitemap.item("https://gleam.run/blog") |
| 11 | |> sitemap.with_frequency(sitemap.Weekly), |
| 12 | sitemap.item("https://gleam.run/blog/gleam-1.0"), |
| 13 | sitemap.item("https://gleam.run/blog/gleam-1.1"), |
| 14 | ]) |
| 15 | |
| 16 | sitemap |> sitemap.to_string() |
| 17 | } |
Further documentation can be found at https://hexdocs.pm/webls.
| Protocol | Version | Status |
|---|---|---|
| Sitemaps | 0.9 | Complete |
| RSS v2.0 | 2.0.1 | Partial |
| Robots.txt | 1997 IDS | Complete |
| Type | to_string | Builder Functions | Validators |
|---|---|---|---|
| Sitemap | Complete | Complete | None |
| RSS v2.0 | Complete | None | None |
| Robots.txt | Complete | Complete | None |
| 1 | gleam run # Run the project |
| 2 | gleam test # Run the tests |
Yes the name is a reference to the
lscommand in unix to list files