Jan 29, 2026 - 1 min read

Content collections and routing

Documents illustration

Content Collections reads files in src/data/posts and turns them into typed data. The file path becomes the URL slug, so nested folders map directly to nested routes.

Example file structure

src/data/posts/
  welcome-to-tanstack-start-blog.mdx
  guides/
    rss-and-sitemaps.mdx
    og-images.mdx

This structure maps to:

  • /posts/welcome-to-tanstack-start-blog

  • /posts/guides/rss-and-sitemaps

  • /posts/guides/og-images

Frontmatter requirements

Required fields
1
2
3
4
5
6
7
8
---
title: "My post"
description: "Short summary for cards and meta tags."
publishDate: "2026-02-01"
tags:
  - template
  - mdx
---
Typed metadata

Content collections adds readingTime, date, and mdast fields so you can build features like reading-time badges or custom indexes without extra parsing.

YN

Hi, I'm Mohamed Afifi. I'm a mobile engineer and founder based in Toronto 🇨🇦. I write deep dives and working systems for developers who value quality, iteration speed, and scalable codebases.