Skip to content

Make post topic optional#29

Merged
HumbleBee14 merged 2 commits into
mainfrom
feature/optional-topic
Jul 16, 2026
Merged

Make post topic optional#29
HumbleBee14 merged 2 commits into
mainfrom
feature/optional-topic

Conversation

@HumbleBee14

Copy link
Copy Markdown
Member

Topics are no longer mandatory. A post can belong to a topic hub or stand alone.

Schema: topicId is now optional (z.enum(...).optional()). Frontmatter for existing posts is unchanged.

What a topicless post keeps: /blog archive, on-site search, tag pages, author page, RSS, Google, and "related" strips (via shared tags). What it opts out of: /topics/<x> hub pages and topic chips — exactly the point.

Guards added at every topicId read site so nothing renders an empty chip or breaks:

  • Homepage cards, PostRow, blog post page (chip, breadcrumb, pagefind-meta all conditional)
  • RSS category, author-page topic grouping, countPostsByTopic, topicName(undefined)
  • Related-posts: topic'd posts relate by topic; topicless posts fall back to shared tags (never match each other via undefined === undefined)

Editor: topic selector labeled "optional" with a "No specific topic" choice; the hard "Pick a topic" validation is removed; the serializer omits topic/topicId frontmatter when none is chosen. (Proposing a new topic was already supported via proposedTopic.)

Verified: built with a real topicless post — appears in /blog with no empty chip, absent from all /topics hubs, build green. Added a serializer test for the omitted-topic case (62 tests pass).

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 16, 2026

Copy link
Copy Markdown

Deploying mlsystems with  Cloudflare Pages  Cloudflare Pages

Latest commit: 162171a
Status:⚡️  Build in progress...

View logs

@github-actions

Copy link
Copy Markdown

@HumbleBee14
HumbleBee14 merged commit f630b35 into main Jul 16, 2026
1 of 2 checks passed
@HumbleBee14
HumbleBee14 deleted the feature/optional-topic branch July 16, 2026 03:34
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