TIL

Merging a small content collection into a bigger one beats a separate one


Had TIL posts as a separate content collection from blog posts. Looked clean on paper. In practice it split link equity across /til/ and /blog/, and every index/layout feature (hero images, drafts, badges) had to be built twice. I noticed the duplication the second time I copy-pasted a draft filter between two nearly identical index pages.

Fix: merge TIL into the blog collection with a category: z.enum(["blog", "til"]).default("blog") field instead of a second collection. Then:

  • /til/[slug] becomes a 301 redirect to /blog/[slug], so old links keep working but there’s one canonical URL per post
  • /til/ index is just the blog collection filtered by category === "til"
  • One set of layouts, one draft-filtering check, one place to add features

Rule of thumb I use now: if two content types share the same fields and render logic, and only differ by “which list shows it,” that’s a filter, not a new collection. Reach for a second collection only when the schema itself diverges.

Mark Lester Mahilum

Mark Lester Mahilum

Claude Code expert based in the Philippines. Building AI-native workflows for businesses and documenting what actually works.