Overview
Blog posts are MDX files managed via TinaCMS and stored under content/posts
. Each post has SEO, a thumbnail, author, category, and a sections array (header, text, image). Slugs are generated from the title.
Location and slug
- Collection name: post
- Path:
content/posts
- Filename: read-only; generated by slugifying the title (lowercase, trimmed).
Fields
- seo — shared SEO object (title, description ≤ 160 chars, Open Graph, article meta).
- thumbnail — required image shown on listing and hero.
- author — defaults to
DEFAULT_AUTHOR
. - category — required; uses predefined options (see below).
- title, description — required text fields.
- createdAt — required; used for sorting and sitemap freshness.
- sections — list of content blocks (Header, Text, Image).
Update seo.openGraph.updatedTime
when you make edits so sitemap entries have a correct lastModified.
Sections and templates
Available templates in posts:
- Header —
variant
(Primary/Secondary) +text
. - Text — rich text body (
content
). - Image — image fields plus an optional
source { title, url }
.
The editor sidebar shows labels (previews) via getSectionLabel
so authors can identify blocks quickly.
Categories
Options: Business, Development, Docs, Guide, Legal, Marketing, Motivation, Reference, Tutorial, User Experience.
Listing page (/blog)
- Route metadata is hardcoded in
/app/blog/page.tsx
. fetchLatestPosts(last = 50)
queries the Tina connection, sorts bycreatedAt
, and returns previews (title
,thumbnail
,author
,description
,category
,createdAt
,slug
).- The page renders FeaturedPost, PostGrid, and a SubscribeNewsletter section.
Single post route (/blog/[slug])
generateStaticParams()
builds slugs from the Tina connection for SSG.generateMetadata()
mapspost.seo
usinggenerateSeoMetadata()
andpathname: blog/<slug>
.- The page fetches the post by slug and renders:
- BlogPostHero (uses
thumbnail
) - BlogPostHeader (title, description, createdAt, category, author)
- BlogSections (maps section types to UI templates)
- SubscribeNewsletter
Draft Mode shows a simple preview screen when enabled.
BlogSections mapping
The renderer maps Tina section types to UI components:
PostSectionsHeader
→HeaderTemplate
PostSectionsText
→TextTemplate
PostSectionsImage
→ImageTemplate
Unknown templates are ignored gracefully.
SEO and sitemap
- Page-level SEO comes from the post’s seo object.
- The sitemap service reads posts from the Tina connection and uses
seo.openGraph.updatedTime
aslastModified
when available.
Guidelines
- Pick a short, descriptive title—it becomes the slug.
- Keep description concise (≤ 160 chars) for better previews.
- Use Primary header for major sections; Secondary for subtopics.
- Add source info to images when applicable.
- Ensure createdAt is accurate; the listing sorts by it.