Skip to content

Add typed publishedDate and author frontmatter fields#184

Merged
kcmartin merged 3 commits into
mainfrom
feat/published-date-badge
Jun 3, 2026
Merged

Add typed publishedDate and author frontmatter fields#184
kcmartin merged 3 commits into
mainfrom
feat/published-date-badge

Conversation

@kcmartin

@kcmartin kcmartin commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

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.

  • Add an optional publishedDate field to the docs schema (docsSchema({ extend: ... })).
  • computeBadge in src/lib/sidebar.ts now prefers publishedDate from frontmatter and falls back to the git first-add date when it's absent.
  • Set publishedDate: 2026-06-02 on the Services page so it shows the New badge.
  • Widen the New badge window from 3 days to two weeks (newThresholdDays).

author

  • Add an optional author field to the same schema. Not displayed on pages; recorded for attribution and available to components later.
  • Set author: kcmartin on the Services and Keeping a Sprite Running pages.

Both fields are optional, so every existing page keeps its current behavior.

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.
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Preview Deployment

Name URL
Preview https://pr-184-superfly-sprites-docs.fly.dev

Commit: 1e909b7

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Lighthouse Results

URL Performance Accessibility Best Practices SEO
/ 🟠 84 🟢 100 🟢 96 🟢 100
/concepts/services/ 🟢 98 🟢 100 🟢 100 🟢 100
/keeping-sprites-running/ 🟢 99 🟢 100 🟢 100 🟢 100

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
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.
@kcmartin kcmartin changed the title Add publishedDate frontmatter to drive the sidebar New badge Add typed publishedDate and author frontmatter fields Jun 3, 2026
@kcmartin kcmartin merged commit 2347749 into main Jun 3, 2026
5 checks passed
@kcmartin kcmartin deleted the feat/published-date-badge branch June 3, 2026 23:14
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.

1 participant