SiteMaps.Location (site_maps v0.1.0)

Copy Markdown View Source

Storage keys of the files written by a process execution.

An execution writes a numbered family of files: the location posts/%{year}/sitemap.xml run with year: 2026 writes posts/2026/sitemap1.xml, posts/2026/sitemap2.xml, ... (with .gz when the index is gzipped). A process without location writes sitemap_<name>1.xml, ... next to the index. When the file name ends with a digit, a - separates it from the counter (posts-12-1.xml). Keys are relative to the index directory and their path segments may only contain A-Z a-z 0-9 . _ ~ -, so they are valid URL paths as they are.

Summary

Functions

Counter key shared by executions writing to the same family.

File family of process executed with args.

Key of the n-th file of the family.

Whether key belongs to the family.

Regex matching the keys any execution of process may write.

Types

t()

@type t() :: %SiteMaps.Location{dir: String.t(), ext: String.t(), stem: String.t()}

Functions

counter_key(location)

@spec counter_key(t()) :: {String.t(), String.t(), String.t()}

Counter key shared by executions writing to the same family.

family(config, process, args)

@spec family(SiteMaps.Config.t(), SiteMaps.Process.t(), map()) :: t()

File family of process executed with args.

key(location, n)

@spec key(t(), pos_integer()) :: String.t()

Key of the n-th file of the family.

member?(location, key)

@spec member?(t(), String.t()) :: boolean()

Whether key belongs to the family.

pattern(config, process)

@spec pattern(SiteMaps.Config.t(), SiteMaps.Process.t()) :: Regex.t()

Regex matching the keys any execution of process may write.