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
home_language?(language : String | Nil) : Bool

Does language have a written homepage (/, /<lang>/)? A partial translation often has none, and its pages must not link /<lang>/.

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)

Every listing (section.pages, section_list, pagination, get_section().pages) reads this, so headless (render = false) pages and non-transparent sections are left out here: they are never written, and listing them linked a 404. A headless transparent section still bubbles its rendered pages up — only its own index is unwritten. get_page is a lookup, not a listing, and still sees them.

Except in a section that is itself headless: nothing of it is ever written, so nothing links a 404, and it is the "data section" pattern (team/_index.md with render = false and a cascade, iterated through get_section(path="team/_index.md").pages). Filtering there emptied it.

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