class

Hwaro::Models::Site

Inherits Reference / Object

Constructors

new(config : Config)
Source

Instance methods

all_content
Source
authors
Source
authors=(authors : Hash(String, Crinja::Value))
Source
build_lookup_index
Source
config
Source
config=(config : Config)
Source
data

New properties for data and authors

Source
data=(data : Hash(String, Crinja::Value))

New properties for data and authors

Source
pages
Source
pages=(pages : Array(Page))
Source
pages_by_section

Lookup indices for performance

Source
pages_by_section=(pages_by_section : Hash(String, Array(Page)))

Lookup indices for performance

Source
pages_for_section(section_name : String, language : String | Nil, items : Array(Page) | Nil = nil, visited : Set(String) | Nil = nil) : Array(Page)
Source
pages_for_section_cache
Source
pages_for_section_cache=(pages_for_section_cache : Hash(Tuple(String, String | Nil), Array(Page)))
Source
section_for(name : String, language : String | Nil) : Section | Nil

Resolve a section by path for a given language, falling back to the language-neutral (default-language) index when no language-specific _index.<lang>.md exists, then to the configured default language.

Source
sections
Source
sections=(sections : Array(Section))
Source
sections_by_name

Keyed by (section path, language) so a multilingual site's per-language _index.<lang>.md files don't collide — previously a single Hash(String, Section) kept only the first-globbed language, making section title/description/sort_by/page_template resolve to the wrong language. Use section_for(name, language) to look up with fallback.

Source
sections_by_name=(sections_by_name : Hash(Tuple(String, String | Nil), Section))

Keyed by (section path, language) so a multilingual site's per-language _index.<lang>.md files don't collide — previously a single Hash(String, Section) kept only the first-globbed language, making section title/description/sort_by/page_template resolve to the wrong language. Use section_for(name, language) to look up with fallback.

Source
sections_by_parent
Source
sections_by_parent=(sections_by_parent : Hash(String, Array(Section)))
Source
taxonomies
Source
taxonomies=(taxonomies : Hash(String, Hash(String, Array(Page))))
Source
taxonomy_pages(name : String, term : String) : Array(Page)
Source
taxonomy_terms(name : String) : Array(String)
Source