Hwaro::Services::FrontmatterConverter
Inherits Reference / Object
Frontmatter Converter converts between YAML and TOML formats
Constants
Frontmatter splitters. The closing-delimiter clause matches trailing
horizontal whitespace and exactly one newline (or end of file) — not
\s*$\n?, which would silently swallow a blank line between the
delimiter and the body. The body capture keeps any blank line as a
leading \n, so round-tripping TOML↔YAML preserves the author's
original spacing (regression: blank line was lost).
Constructors
Class methods
Serialize a frontmatter date/time value without corrupting the calendar day.
Frontmatter dates are commonly written as TOML/YAML local dates such as
2026-05-20, which parse to midnight in the local time zone. Rendering
those through to_rfc3339 (always UTC) rolls the day back in any
positive-offset zone — e.g. in KST 2026-05-20 becomes
2026-05-19T15:00:00Z, silently shifting the post's date on a format
round-trip. When the value carries no time-of-day we emit a bare
YYYY-MM-DD date and keep the day; genuine timestamps round-trip as RFC 3339.
Instance methods
Convert a single file's frontmatter