Repository navigation
Footer copyright: collapse a same-year range to a single year - #2720
Merged
Merged
Conversation
- 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
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
from_yeardiffers from the resolvedto_year; blank year fields count as unsetto_yearvalues such as "present" working (docsy.dev uses one)from_yearis later thanto_yearauthorsas Markdown on every page, fixing mangled footers on non-Markdown (e.g. Org) pagesparams.copyright(new "Footer copyright" section) and a changelog entry