WebLS

A Gleam library for generating sitemaps and RSS feeds and more. to meet all your common web listing needs.

Package Version Hex Docs

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

ProtocolVersionStatus
Sitemaps0.9Complete
RSS v2.02.0.1Partial
Robots.txt1997 IDSComplete

Utility Support

Typeto_stringBuilder FunctionsValidators
SitemapCompleteCompleteNone
RSS v2.0CompleteNoneNone
Robots.txtCompleteCompleteNone

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

Search Document