Blog Engine
Rules
- MDX for content:
content/blog/[slug].mdx— frontmatter with title, description, publishedAt, updatedAt, tags, image - Dynamic routing:
app/blog/[slug]/page.tsx— fetch MDX at build time, generate static params from file system - RSS feed: generate
feed.xmlat/rss.xml— include title, description, pubDate, link, guid for each post — regenerate on build - Sitemap: generate
sitemap.xmlwith all blog URLs, lastmod dates, changefreq — submit to Google Search Console - JSON-LD structured data:
Articleschema on every post — headline, datePublished, dateModified, author, image, publisher - Related posts: tag-based matching — find posts sharing 2+ tags, fallback to most recent — display 3 related posts
- Table of contents: auto-generate from H2/H3 headings in MDX — render as sticky sidebar on desktop
- Pagination: 10 posts per page,
/blog/page/[num]— include prev/next links for SEO
Frontmatter Schema
title: "Post Title"
description: "Meta description under 160 chars"
publishedAt: "2025-01-15"
updatedAt: "2025-02-01"
tags: ["nextjs", "react"]
image: "/blog/post-title/cover.jpg"
author: "Author Name"
RSS Feed Pattern
Serve from API route or generate at build. Required fields: <title>, <link>, <description>, <item> per post with <guid>, <pubDate>.
Avoid
- Missing
publishedAtin frontmatter — breaks RSS and sorting - No sitemap submission — Google won't discover new posts quickly
- Skipping JSON-LD — loses rich snippet eligibility
- Hardcoding related posts — use tag matching for automatic relevance