diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-20 22:33:07 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-20 22:33:07 +0200 |
| commit | 671c4264707ec8c81845059746632b00f2481d88 (patch) | |
| tree | 790100dcc0077532d9446478e51d4cd40209c1c6 /man/colitur-templates.5 | |
| parent | 1988d350242b47aa52aa07904c495e7e2c0eba82 (diff) | |
| download | colitur-671c4264707ec8c81845059746632b00f2481d88.tar.gz colitur-671c4264707ec8c81845059746632b00f2481d88.zip | |
fix(render): a month answers to both spellings of its own name
A week object carries month_name/month_num/month_abbr, because at that
level a bare `name` would be ambiguous. An author who learned those names
inside {{#weeks}} reaches for them one level up inside {{#months}} too --
where they resolved to nothing, and an unknown key renders as the empty
string by design, so the result was a silently blank month heading rather
than any error.
Found by writing a template from scratch rather than copying a shipped
one; every shipped template sidesteps it, which is why nothing caught it.
The aliases are additive, so no existing template or golden changes.
colitur-templates(5) now documents both spellings and says why they
exist.
Diffstat (limited to 'man/colitur-templates.5')
| -rw-r--r-- | man/colitur-templates.5 | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/man/colitur-templates.5 b/man/colitur-templates.5 index e04560b..e668b55 100644 --- a/man/colitur-templates.5 +++ b/man/colitur-templates.5 @@ -566,13 +566,21 @@ template iterates over directly, without going through .BR months . .SS month .TP -.B num -The month number, 1 through 12, as a string. +.BR num ", " month_num +The month number, 1 through 12, as a string. The two spellings are the same +value \(em see the note at the end of this subsection. .TP -.B name +.BR name ", " month_name The month's own resolved display name in the active language (e.g. .RB \(lq Ianuarius \(rq ), -a plain string. +a plain string. Both spellings are the same value. +.TP +.B month_abbr +The month's abbreviated name in the active language (e.g. +.RB \(lq Ian \(rq ), +from the language file's own +.B [month_abbr] +section. .TP .B days This month's own @@ -587,6 +595,24 @@ last rows padded with blank cells (see .B day \(-> in_month below) so every row has seven entries regardless of which weekday the month starts or ends on. +.PP +.B "Why two spellings." +A +.B week +object (below) carries +.BR month_name ", " month_num " and " month_abbr, +because at that level a bare +.B name +would be ambiguous. An author who learned those names inside +.B {{#weeks}} +naturally reaches for them one level up, inside +.BR {{#months}} . +Before colitur 0.9 they resolved to nothing there, and because an unknown +key renders as the EMPTY STRING by design (see +.B SCOPE AND LOOKUP +above), the result was a silently blank month heading rather than any +error. A month now answers to both. Prefer the short forms in new +templates: a month is the only scope where they are unambiguous. .SS week .TP .B num |
