Repository navigation
fix(atom): emit a full date-time for entry updated when updated_at is a date - #226
Merged
eelcoj merged 1 commit intoNov 23, 2026
Merged
Conversation
… a date Frontmatter updated_at can be a Date (YAML 2023-05-15), and Date#iso8601 yields a date-only string, which is not a valid Atom date construct (RFC 4287 requires RFC 3339 date-time). Convert through in_time_zone first.
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.
Related to #220 and #216 (date formatting in feeds).
Frontmatter is loaded with
YAML.safe_load(..., permitted_classes: [Date, ...]), soupdated_at: 2023-05-15becomes aDate. Inatom.erbthe entry's<updated>is(metadata.updated_at || published_at)&.iso8601, andDate#iso8601returns2023-05-15. Atom (RFC 4287) requires<updated>to be an RFC 3339 date-time, so feed validators reject the date-only value.The fix goes through
in_time_zonefirst (Date→ midnight inTime.zone;Time/TimeWithZoneunchanged), so the output becomes e.g.2023-05-15T00:00:00+00:00. String values are a separate case, handled in #225.Tests: new case in
atom_test.rbasserting the<updated>of the "Sample Post" entry (fixture hasupdated_at: 2023-05-15) is a full date-time.This change was prepared with the help of an AI coding assistant (Claude); the author is responsible for it.