Hwaro::Models::Page
Inherits Reference / Object
Constants
Extract summary from content using <!-- more --> marker Returns content before the marker, or nil if no marker found Note: @raw_content has front matter already stripped during parsing
Fence-aware: a marker shown inside a fenced code block (a docs page
demonstrating the feature) is literal text, not a split point. The
per-line pattern no longer matches a marker whose parts sit on
different lines — degenerate input the old multi-line \s* accepted.
Constructors
Instance methods
Build warnings collected during rendering (used for error overlay in serve mode)
Build warnings collected during rendering (used for error overlay in serve mode)
Calculate reading time in minutes (assuming ~200 words per minute)
Calculate word count from raw content Note: @raw_content already has front matter stripped during parsing, so we only need to remove HTML tags and markdown syntax.
Fingerprint of the merged section [cascade] values applied to this page (empty when none apply). Stored in the build cache so editing a parent _index.md's cascade invalidates descendant pages whose own source files did not change.
Fingerprint of the merged section [cascade] values applied to this page (empty when none apply). Stored in the build cache so editing a parent _index.md's cascade invalidates descendant pages whose own source files did not change.
Collect assets from page directory
When content_files is configured ([content.files] with
allow_extensions), co-located bundle assets are filtered through the
SAME allow/disallow rules as standalone content files. Without this, a
root _index.md turns the whole content/ tree into one recursive
bundle and republishes arbitrary non-markdown files (e.g.
content/public/robots.txt) to the output regardless of
allow_extensions. When [content.files] is not configured, every
non-markdown file is collected (unchanged behavior).
True when a page should be omitted from generated listings (taxonomy indexes, related posts, …): drafts, preview-only unpublished pages, and synthetic generated pages.
New: Extra field for arbitrary custom metadata from front matter.
Values are recursive (ExtraValue) so nested [extra.*] subtables
and arrays-of-tables round-trip into {{ page.extra.a.b }} in templates.
New: Extra field for arbitrary custom metadata from front matter.
Values are recursive (ExtraValue) so nested [extra.*] subtables
and arrays-of-tables round-trip into {{ page.extra.a.b }} in templates.
New: In search index - whether to include in search index
New: Insert anchor links - whether to add anchor links to headings.
Tri-state: nil (front matter silent) falls back to the site-wide
[markdown] insert_anchor_links config; an explicit true/false wins.
New: Insert anchor links - whether to add anchor links to headings.
Tri-state: nil (front matter silent) falls back to the site-wide
[markdown] insert_anchor_links config; an explicit true/false wins.
Whether parsing (front-matter / markdown) failed for this page
Deferred [permalinks] error from the parse fan-out (a date-token
pattern matched a dateless page). Whether it's fatal isn't knowable
until cascades and draft/expiry filtering ran: a page filtered out
of the build (or a headless render: false page) never publishes
the URL, so only surviving renderable pages raise — see
ParseContent#raise_on_permalink_errors!.
Deferred [permalinks] error from the parse fan-out (a date-token
pattern matched a dateless page). Whether it's fatal isn't knowable
until cascades and draft/expiry filtering ran: a page filtered out
of the build (or a headless render: false page) never publishes
the URL, so only surviving renderable pages raise — see
ParseContent#raise_on_permalink_errors!.
Plain-text rendering of the <!-- more --> summary, safe to embed
in single-line contexts like og:description,
twitter:description, or a feed <description>. Uses the
already-rendered summary_html and strips markup so raw markdown
(## headings, code fences, math, literal newlines) never leaks
into meta tags — see https://github.com/hahwul/hwaro/issues/491.
Returns nil when the page has no summary. Soft-truncates to limit
characters on a word boundary.
Recompute unpublished from the publication window (date in the
future or expires in the past) relative to the build's single now.
Called by the parse-phase filter and the incremental (--cache)
re-parse path so every downstream consumer sees a consistent value.
True when a page is eligible for the search index / llms.txt: it emits HTML, isn't a draft or preview-only unpublished page, opts into the search index, and isn't a synthetic generated listing page.
New: Summary - content before <!-- more --> marker or auto-generated
Rendered HTML for the chunk before <!-- more -->. Populated by
the build pipeline after extract_summary runs and the markdown
processor is available; nil for pages without a <!-- more -->
marker (in which case page.summary falls back to description).
See https://github.com/hahwul/hwaro/issues/491.
Rendered HTML for the chunk before <!-- more -->. Populated by
the build pipeline after extract_summary runs and the markdown
processor is available; nil for pages without a <!-- more -->
marker (in which case page.summary falls back to description).
See https://github.com/hahwul/hwaro/issues/491.
Resolve the term list for a configured taxonomy name. Most
taxonomies live in @taxonomies, but a few — tags and authors
— are stored on dedicated Page properties so other features
(the tags shortcut, the site.authors aggregation) can reach
them without a hash lookup. Centralizing the fallback here keeps
call sites (Taxonomies generator, related-posts scoring, …) from
forgetting any of the special cases.
True when the page is outside its publication window at build time
(future date or past expires). Such pages only survive the parse
filter under --include-future / --include-expired — preview flags —
and must then behave exactly like drafts under --drafts: the HTML
page renders, but the page stays out of every public discovery
surface (sitemap, feeds, search index, llms.txt) and out of
generated listings (taxonomies, series, related posts, authors).
True when the page is outside its publication window at build time
(future date or past expires). Such pages only survive the parse
filter under --include-future / --include-expired — preview flags —
and must then behave exactly like drafts under --drafts: the HTML
page renders, but the page stays out of every public discovery
surface (sitemap, feeds, search index, llms.txt) and out of
generated listings (taxonomies, series, related posts, authors).