Add typed publishedDate and author frontmatter fields#184
Merged
Conversation
The New badge keyed off the date a file first landed in git, so a rewritten older page (like the Services concept) never re-flagged as new. Add an optional publishedDate field to the docs schema and have computeBadge prefer it over git history. Set it on the Services page.
Contributor
Preview Deployment
Commit: |
Contributor
Lighthouse Results
|
Contributor
E2E Test Results✅ Tests success Ran against: https://pr-184-superfly-sprites-docs.fly.dev |
Add an author field to the docs schema alongside publishedDate, and set it on the Services and Keeping a Sprite Running pages. Not displayed; recorded for attribution and available to components later.
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.
What
Two related additions to the docs content schema, both optional typed frontmatter fields.
publishedDate + the New badge
The sidebar "New" badge keyed off the date a file first appeared in git (
git log --diff-filter=A | tail -1). That works for genuinely new files, but a page that has existed in the repo for a while and was later rewritten and published, like the Services concept page, keeps its original add date and never re-flags as new.publishedDatefield to the docs schema (docsSchema({ extend: ... })).computeBadgeinsrc/lib/sidebar.tsnow preferspublishedDatefrom frontmatter and falls back to the git first-add date when it's absent.publishedDate: 2026-06-02on the Services page so it shows the New badge.newThresholdDays).author
authorfield to the same schema. Not displayed on pages; recorded for attribution and available to components later.author: kcmartinon the Services and Keeping a Sprite Running pages.Both fields are optional, so every existing page keeps its current behavior.