class

Hwaro::Services::PageRouteIndex

Inherits Reference < Object

The page URLs a default build writes, computed from the sources the way the build computes them: publish state from ContentLister (the publish-state source of truth), the URL through Utils::PermalinkResolver (slug, path, [permalinks], language prefix, versions — the resolver the build and tool platform share), plus every page's aliases.

check-links used to treat the source tree as the URL space: /posts/x/ was live whenever content/posts/x.md existed. That passed links to drafts and to the pre-slug path (the build writes neither), reported every slug/path/alias/[permalinks] URL dead until a build had populated public/, and resolved relative links against the source directory although the browser resolves them against the page's URL.

Constants

NOT_RENDERED = "not rendered"

Publish-state label for a page that publishes but is never written (render = false).

Constructors

new(content_dir : String, config : Models::Config | Nil)
Source

Class methods

normalize(url : String) : String

A page URL or link path in the form the build writes it: leading slash, a trailing index.html dropped, and a trailing slash.

Source

Instance methods

bundle_asset?(url : String) : Bool

True when url names a file a published bundle or section copies beside its own URL.

Source
pager_for(url : String) : Tuple(String, Int32, String) | Nil

{paginate_path, per_page, source directory} of the published section at url when it writes /<paginate_path>/N/ pages.

Source
published?(url : String) : Bool

Does a default build write a page or alias at url?

Source
state_for(source : String) : String | Nil

Publish-state label of the page at source (published, draft, future, expired, or NOT_RENDERED), nil when unknown.

Source
url_for(source : String) : String | Nil

The URL a default build gives the page at source, or nil when the file is not a page this index could read.

Source