Validated configuration of a sitemap module. Options are given to use SiteMaps, read from the
application environment when :otp_app is set, and returned by the optional
SiteMaps.config/1 callback, in that order of precedence, later sources winning.
Options
:url- Required. Public URL of the sitemap index. Ending in.xml.gzgzips every file.:adapter- Required. Storage adapter,Moduleor{Module, opts}.:max_links- URLs per sitemap file. The default value is50000.:max_bytes- Uncompressed bytes per sitemap file. The default value is50000000.:max_news- News URLs per sitemap file. The default value is1000.:max_index_links- Entries in the index. The default value is50000.:default_changefreq-<changefreq>for URLs without one. The default value isnil.:default_priority-<priority>for URLs without one. The default value isnil.:xsl_stylesheet_url- XSL stylesheet of urlsets. The default value isnil.:xsl_index_stylesheet_url- XSL stylesheet of the index. The default value isnil.:cache_control- Cache-Control stored with files. The default value is"public, max-age=3600".:max_concurrency- Processes run in parallel. Defaults to schedulers online. The default value isnil.:tmp_dir- Directory for files being built. Defaults toSystem.tmp_dir!/0. The default value isnil.
Summary
Functions
Absolute URL of the file stored under key.
Validates opts and builds the configuration. Raises on invalid options.
Resolves a path against the site origin. Absolute http(s) URLs are returned unchanged.
Storage key of url, or :error when the URL is outside the sitemap directory.
Types
@type t() :: %SiteMaps.Config{ adapter: {module(), keyword()}, cache_control: String.t() | nil, default_changefreq: atom() | nil, default_priority: float() | nil, gzip?: boolean(), index_key: String.t(), max_bytes: pos_integer(), max_concurrency: pos_integer(), max_index_links: pos_integer(), max_links: pos_integer(), max_news: pos_integer(), root_uri: URI.t(), tmp_dir: Path.t(), url: String.t(), xsl_index_stylesheet_url: String.t() | nil, xsl_stylesheet_url: String.t() | nil }
Functions
Absolute URL of the file stored under key.
Validates opts and builds the configuration. Raises on invalid options.
Resolves a path against the site origin. Absolute http(s) URLs are returned unchanged.
Storage key of url, or :error when the URL is outside the sitemap directory.