Hwaro::Utils::PermalinkResolver
Constants
Tokens accepted inside a [permalinks] pattern value. Each token
must be a whole /-separated segment (e.g. /:year/:slug/).
Instance methods
True when the [permalinks] target contains a :token segment,
i.e. it is a Hugo-style pattern rather than a directory remap.
Compute the canonical site-relative URL for a content file.
Precedence: explicit path front matter (custom_path) wins outright;
otherwise the language prefix for non-default languages is emitted
BEFORE the pattern/remap output (/ko/2026/03/05/…), then the first
matching [permalinks] rule applies (pattern expansion for leaf
pages, directory remap otherwise), and the result is normalized to a
leading- and trailing-slash directory URL.
A date-token pattern on a dateless page raises HWARO_E_CONTENT.
Callers that can't yet know whether the page will publish (the parse
fan-out runs before cascades and draft/expiry filtering) use
resolve_url_lenient and defer the error to after filtering.
Like resolve_url, but a date-token pattern on a dateless page
falls back to the default directory URL and REPORTS the problem in
the second tuple slot instead of raising — so a draft or headless
page the build is about to discard can't abort the whole build over
a URL it never publishes.
Validate every :token segment of a pattern against VALID_TOKENS.
Raises a classified config error so hwaro build exits with the
stable config exit code instead of silently emitting literal
:tokne path segments.