Documentation

Guides and references

Frontend

Blog

Blog setup, content, and structure in NextBento.

Overview

NextBento includes a blog powered by MDX files in content/blog/. Posts are listed on /blog and individual posts at /blog/[slug].

File Structure

content/blog/
  your-post.mdx      # Each post is an MDX file
  another-post.mdx

lib/blog/
  posts.ts           # getAllPosts, getPostBySlug, getAllPostSlugs

Post Frontmatter

Each MDX post uses frontmatter:

---
title: Your Post Title
description: Short description for SEO and listing
date: 2024-01-15
author: Your Name
tags: [nextjs, saas, tips]
image: /images/post-cover.jpg  # optional
---

Adding a Post

  1. Create content/blog/my-new-post.mdx
  2. Add frontmatter (title, description, date, author, tags)
  3. Write content in MDX
  4. The post appears on /blog and at /blog/my-new-post
Blog index at /blog

Routes

RouteFileDescription
/blogapp/blog/page.tsxBlog index, lists all posts
/blog/[slug]app/blog/[slug]/page.tsxIndividual post page

Layout

Blog pages use LandingHeader and LandingFooter from Landing 1. Posts are rendered with MDX.

SEO

  • Blog index: Blog schema, Article schema per post
  • Post pages: Article schema, metadata from frontmatter
  • Sitemap: Add /blog and /blog/* to sitemap

Next Steps