module

Hwaro::Core::Build::ContentGenerate

Instance methods

authored_twin_exists?(path : String, content_root : String = "content", ignore : Models::ContentFilesConfig | Nil = nil, default_language : String | Nil = nil, config : Models::Config | Nil = nil, page_url : String | Nil = nil) : Bool

True when an authored source claims this plan's path or URL: the flat file (<stem>.md / .markdown, mirroring the ReadContent phase's PAGE_EXTENSIONS) or its leaf-bundle twin (<stem>/index.md), which publishes the same /section/slug/ URL. Shared by the build's authored-wins guard and hwaro tool list, so the two can't drift.

Probed with a case-SENSITIVE directory-entry comparison, not File.exists?: APFS/NTFS fold case, so an exists? probe would drop a generated page on macOS that Linux CI publishes — the same config must produce the same page set on every platform (build-determinism invariant).

A source [content] ignore hides (ignore, the site's content_files) claims nothing: the build never reads it.

default_language (a multilingual site's default code) adds the spelled-out default suffix (<stem>.en.md), which publishes the same URL as <stem>.md. A subsection index <stem>/_index.md owns that URL too — unless config and page_url (the generated page's resolved URL, plan_url) show the two publish at different URLs: section indexes skip pattern rules, so products = "/shop/:slug/" puts generated red at /shop/red/ while products/red/_index.md keeps /products/red/ — unless its front matter path/slug moves it (see section_url).

Source
item_to_extra(value : Crinja::Value, depth : Int32 = 0) : Models::ExtraValue

Convert a source record (Crinja::Value) into page.extra shape so templates can read EVERY record field as page.extra.item.<field> without the rule having to map each one.

Source
plan(config : Models::Config, data : Hash(String, Crinja::Value), env : Crinja, include_bodies : Bool = true) : Array(Plan)

Evaluate every rule against the assembled site.data.

env must carry hwaro's filters (and, when include_bodies is true and a rule uses body_template, the template loader) — the build passes its own environment. include_bodies: false skips body evaluation entirely for callers that only need identities (hwaro tool list).

Source
plan(rules : Array(Models::ContentGenerateConfig), data : Hash(String, Crinja::Value), env : Crinja, include_bodies : Bool = true, lenient_missing_keys : Array(String) = [] of String) : Array(Plan)

Rule-list variant so callers with their own rule handling (hwaro tool list plans rule-by-rule to isolate failures) don't have to mutate a loaded Config.

Source
plan_url(plan : Plan, config : Models::Config) : String

The URL a plan's page publishes at: its path plus the front matter the synthetic markdown carries (title, date; never slug or path).

Source
template_spec?(spec : String) : Bool

Public for Services::GeneratedContent, which only evaluates plain field specs (a template may need the site's template loader).

Source

Nested types