class

Hwaro::Core::Lifecycle::BuildContext

Inherits Reference / Object

Build context that flows through all phases

Constructors

new(options : Config::Options::BuildOptions)
Source

Instance methods

all_pages

Convenience: all pages including sections (cached after first call)

Source
builder

The Builder driving this run. Hooks that render through a Builder (taxonomy generation) reuse it — its Crinja value caches are warm with every page already converted — instead of constructing a fresh Builder that re-converts the whole site a second time.

Source
builder=(builder : Build::Builder | Nil)

The Builder driving this run. Hooks that render through a Builder (taxonomy generation) reuse it — its Crinja value caches are warm with every page already converted — instead of constructing a fresh Builder that re-converts the whole site a second time.

Source
cache

Cache reference

Source
cache=(cache : Build::Cache | Nil)

Cache reference

Source
config
Source
config=(config : Models::Config | Nil)
Source
excluded_cascade_sections

Sections removed by an early (pre-ParseContent) draft/expired/future filter — e.g. a custom AfterReadContent hook — whose [cascade] must still reach their descendants. apply_cascades merges these with the surviving sections when building the cascade map. The default build filters inside the ParseContent phase (after cascades apply), so this stays empty there.

Source
excluded_cascade_sections=(excluded_cascade_sections : Array(Models::Section))

Sections removed by an early (pre-ParseContent) draft/expired/future filter — e.g. a custom AfterReadContent hook — whose [cascade] must still reach their descendants. apply_cascades merges these with the surviving sections when building the cascade map. The default build filters inside the ParseContent phase (after cascades apply), so this stays empty there.

Source
get_bool(key : String, default : Bool = false) : Bool
Source
get_int(key : String, default : Int32 = 0) : Int32
Source
get_string(key : String, default : String = "") : String

Get metadata with default

Source
invalidate_all_pages_cache

Invalidate the cached all_pages array (call after modifying pages/sections)

Source
metadata

Phase-specific metadata for inter-hook communication

Source
metadata=(metadata : Hash(String, String | Bool | Int32 | Float64))

Phase-specific metadata for inter-hook communication

Source
options

Build options

Source
options=(options : Config::Options::BuildOptions)

Build options

Source
output_dir

Output

Source
output_dir=(output_dir : String)

Output

Source
page_or_section_set_changed

True when the global page/section set changed since the previous cached build (page added/removed, listing metadata moved). Set by the Render phase BEFORE it records the new fingerprints — Generate can't re-check the cache itself at that point — so the SEO/search skip_if_unchanged fast path doesn't keep a deleted page in the sitemap/search index when no surviving page happened to re-render.

Source
page_or_section_set_changed=(page_or_section_set_changed : Bool)

True when the global page/section set changed since the previous cached build (page added/removed, listing metadata moved). Set by the Render phase BEFORE it records the new fingerprints — Generate can't re-check the cache itself at that point — so the SEO/search skip_if_unchanged fast path doesn't keep a deleted page in the sitemap/search index when no surviving page happened to re-render.

Source
pages

Content (use setter to auto-invalidate all_pages cache)

Source
pages=(value : Array(Models::Page))

Setters that auto-invalidate cache

Source
partial_render

True when the current run only handles a subset of the site's pages — set on both passes of a --fast-start session (priority + deferred). Hooks that persist per-page state (e.g. the OG image manifest) use this to skip the "truncate entries for missing pages" prune, so the second pass doesn't wipe the first pass's writes.

Source
partial_render=(partial_render : Bool)

True when the current run only handles a subset of the site's pages — set on both passes of a --fast-start session (priority + deferred). Hooks that persist per-page state (e.g. the OG image manifest) use this to skip the "truncate entries for missing pages" prune, so the second pass doesn't wipe the first pass's writes.

Source
priority_pages

When --fast-start is active, this is populated with the subset of pages the initial pass should process (homepage + recent N + section indexes). BeforeRender hooks (OG image, image resize) consult this to skip work for the deferred subset; the background render pass clears it and re-runs those hooks for the rest. Nil outside of fast-start.

Source
priority_pages=(priority_pages : Array(Models::Page) | Nil)

When --fast-start is active, this is populated with the subset of pages the initial pass should process (homepage + recent N + section indexes). BeforeRender hooks (OG image, image resize) consult this to skip work for the deferred subset; the background render pass clears it and re-runs those hooks for the rest. Nil outside of fast-start.

Source
profiler

Profiler reference (only set when --profile is active). Allows expensive hooks (OG image, image resize) to record their own timing so the true cost distribution inside the Render phase becomes visible.

Source
profiler=(profiler : Hwaro::Profiler | Nil)

Profiler reference (only set when --profile is active). Allows expensive hooks (OG image, image resize) to record their own timing so the true cost distribution inside the Render phase becomes visible.

Source
raw_files

Raw files (JSON, XML, etc.)

Source
raw_files=(raw_files : Array(RawFile))

Raw files (JSON, XML, etc.)

Source
sections
Source
sections=(value : Array(Models::Section))
Source
set(key : String, value : String | Bool | Int32 | Float64)

Set metadata with type safety

Source
site

Site data

Source
site=(site : Models::Site | Nil)

Site data

Source
stats

Track build statistics

Source
stats=(stats : BuildStats)

Track build statistics

Source
templates

Templates

Source
templates=(templates : Hash(String, String))

Templates

Source