Skip to content

Footer copyright: collapse a same-year range to a single year - #2720

Merged
chalin merged 18 commits into
docsy:mainfrom
chalin:chalin-m24-copyright-years-2026-0815
Aug 16, 2026
Merged

chalin merged 18 commits into
docsy:mainfrom
chalin:chalin-m24-copyright-years-2026-0815

Conversation

@chalin

@chalin chalin commented Aug 15, 2026 •

Copy link
Copy Markdown
Collaborator
  • Fixes Show only one year when copyright year range is a signle year #2047; supersedes Show only one year when copyright year range is a single year #2091 (thanks @tcrouch for seeding the fix)
  • Contract:
    • Renders a year range only when from_year differs from the resolved to_year; blank year fields count as unset
    • Keeps non-year to_year values such as "present" working (docsy.dev uses one)
    • Logs a build warning when from_year is later than to_year
    • Renders authors as Markdown on every page, fixing mangled footers on non-Markdown (e.g. Org) pages
    • Fails the build on non-scalar year values, which main rendered verbatim
  • Tests:
    • Contract tests, red-proven against the pre-fix partial
    • The fixture harness gains Hugo CLI arg pass-through, used to pin the build clock
  • Docs: adds the first user-guide home for params.copyright (new "Footer copyright" section) and a changelog entry
  • Preview(s):

chalin added 3 commits August 15, 2026 12:15
- Renders a year range only when `from_year` differs from the resolved
  `to_year`; `to_year` keeps accepting non-year strings such as "present"
- Contract tests are red-proven against the pre-fix partial; the fixture
  harness gains Hugo CLI arg pass-through, used to pin the build clock
- Adds the first user-guide home for `params.copyright`, previously
  documented only in the 0.9.0 release post; adds a changelog entry
chalin added 15 commits August 15, 2026 12:24
- Type-preserving YAML serialization in the test helper plus a
  mixed-type case (int from_year, quoted to_year): kills the
  reviewer's `ne . $toYear` mutant, which previously passed 6/6
- Derives the clock sentinel from the runtime year, closing the
  2030 false-clean window
- Docs: site-copyright fallback also applies to an empty
  `params.copyright` (Hugo `with` truthiness)
- Trims both year params, folding blank values into the existing
  default path instead of rendering a dangling dash; red-proven
  (both new tests fail pre-trim)
- Locks the reviewed contract: empty `params.copyright` (map or
  string) takes the site-copyright fallback, same rule as blank
  fields at field level
- Reversed ranges still render as configured but now self-report;
  the all-digit guard keeps non-year values such as "present" out
  of the int comparison. Red-proven, with a no-warn guard over the
  valid configs
- Replaces the "defaults to to_year" fiction with the observable
  rule: unset or equal to to_year renders a single year
- Narrows the warn guard to 1-9999 (no leading zero): out-of-range
  digit strings no longer abort the build at the int cast (red-proven),
  and leading-zero values skip Go's octal parsing; outside the domain,
  values render as configured with no diagnostic
- Closes the round-2 mutant gaps: asserts the reversed range still
  renders, exercises equality and padded values in the no-warn table,
  pins padded-value trimming and the fallback's raw-HTML rendering
- RenderString followed each page's markup, mangling authors links in
  the footer of non-Markdown (e.g. Org) pages; red-proven with a mixed
  md/org fixture
- Docs: constrains authors to single-paragraph Markdown; scopes the
  reversed-range warning claim to year values
- Closes two mutant-proven false-clean paths on touched code: the
  reflect.IsMap dispatch (string-form params.copyright had zero
  coverage) and the default-authors pipeline stage
- Docs: single-year rule now stated once (the from_year bullet)
- Documents the harness's args and env options; corrects the 0.9.0
  post's fallback-rendering claim (HTML, not markdown -- inaccurate at
  publication)
- Docs: leads with the launch-year recipe (collapse rule stays in the
  from_year bullet; the reversed-range note trails the example)
- Trims contract restatements from test comments to pointers; homes the
  warn guard's why in the template; affirmative assert messages
@chalin
chalin merged commit 94a9a27 into docsy:main Aug 16, 2026
16 checks passed
@chalin
chalin deleted the chalin-m24-copyright-years-2026-0815 branch August 16, 2026 15:52
@chalin chalin added this to the 0.17.0 milestone Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show only one year when copyright year range is a signle year

1 participant