Skip to content

feat(templates): add updated-post blog template - #291

Open
sank8-2 wants to merge 2 commits into
codercops:devfrom
sank8-2:feat/blog-updated-post
Open

sank8-2 wants to merge 2 commits into
codercops:devfrom
sank8-2:feat/blog-updated-post

Conversation

@sank8-2

@sank8-2 sank8-2 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

Closes #289

Adds the blog-updated-post template for refreshed posts that want to say what changed: an "Updated" label in the accent, the post title large under it, a dates line ("First published …" · "Updated …"), up to three short "What changed" lines, and the site name at the bottom.

  • Blank change lines are skipped with no gaps; the "What changed" heading hides when all three are blank.
  • Empty or whitespace-only published, updated, or site name hide cleanly (no stray separator).
  • Long titles shrink with autoFontSize() and then truncate; change lines and the site name truncate too.
  • The label and accent text stay readable on light and dark backgrounds via contrastText / mixColors.

How I Tested This

  • npm run check — 0 errors (pre-existing hints only).
  • npm test -- tests/templates/updated-post.test.ts — 15 tests passed (registration/re-export, 1200×630 root, flex on every div, defaults order, blank change skipping, heading hide, empty dates/site name, long title shrink+truncate, light/dark contrast).
  • npm run check re-run after registering in blog/index.ts and registry.ts.

AI Assistance

OpenCode drafted the template and tests; Cursor helped move the work onto a dev-based branch and resolve export/registry conflicts. I reviewed the diff and ran the checks above locally.

Type of Change

  • New template

Checklist

  • This PR targets dev
  • I was assigned the linked issue
  • npm run check passes
  • npm run test passes with the default timeout
  • Tested locally
  • New template follows the Template Guidelines

Resolve registry and blog index conflicts by keeping table-of-contents from
dev alongside the updated-post template.
@sank8-2
sank8-2 force-pushed the feat/blog-updated-post branch from 01ded7a to a73ad60 Compare October 27, 2026 14:17

This branch has not been deployed

No deployments
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.

Add the Updated Post blog template (blog-updated-post)

1 participant