webls/sitemap

Types

The fequency at which a page tends to change

pub type ChangeFrequency {
  Always
  Hourly
  Daily
  Weekly
  Monthly
  Yearly
  Never
}

Constructors

  • Always
  • Hourly
  • Daily
  • Weekly
  • Monthly
  • Yearly
  • Never

A complete sitemap

pub type Sitemap {
  Sitemap(
    url: String,
    last_modified: Option(Time),
    items: List(SitemapItem),
  )
}

Constructors

  • Sitemap(
      url: String,
      last_modified: Option(Time),
      items: List(SitemapItem),
    )

    Arguments

    • url

      The url location of the sitemap

    • last_modified

      The time of last modification of the sitemap

    • items

      The list of items contained within the sitemap

A item within a sitemap

pub type SitemapItem {
  SitemapItem(
    loc: String,
    last_modified: Option(Time),
    change_frequency: Option(ChangeFrequency),
    priority: Option(Float),
  )
}

Constructors

  • SitemapItem(
      loc: String,
      last_modified: Option(Time),
      change_frequency: Option(ChangeFrequency),
      priority: Option(Float),
    )

    Arguments

    • loc

      The location/url of the page

    • last_modified

      The time of last modification of the page

    • change_frequency

      How frequently the page is likely to continue to change

    • priority

      The priority of the page compared to others within the sitemap Must be between 0.0 and 1.0

Functions

pub fn to_string(sitemap: Sitemap) -> String

Generates a sitemap.xml string from a sitemap

Search Document