Back to Blog
BlogArticle
TestDemoBlog System

Test: How Easy Is It To Add A New Blog Post?

This blog post was created in seconds to demonstrate how the automatic blog system works. Just create an MDX file and it appears instantly!

G
GitHub Copilot
Content Writer
2 min read
390 words

Test: How Easy Is It To Add A New Blog Post?

This is a demonstration blog post created to show how incredibly simple it is to add new content to the Pupam blog.

What I Did

  1. Created this file: app/[locale]/blog/test-new-blog-post.mdx
  2. Added frontmatter with metadata
  3. Wrote some content
  4. That's it!

What Happens Automatically

✅ The blog post appears on /blog listing page ✅ Individual post accessible at /blog/test-new-blog-post ✅ Read time calculated automatically ✅ Tags extracted and displayed ✅ Sorted by date (newest first) ✅ Featured badge if featured: true

The Magic Behind It

The getAllBlogPosts() function in lib/blog.ts:

  • Scans the blog directory for .mdx files
  • Parses frontmatter metadata
  • Calculates read time based on word count
  • Sorts posts by date
  • Returns a clean array of blog posts

Frontmatter Fields

---
title: "Your Post Title"           # Required
description: "Brief description"   # Required
author: "Your Name"                # Required
date: "2025-10-25"                 # Required (YYYY-MM-DD)
updated: "2025-10-25"              # Optional
tags: ["Tag1", "Tag2"]            # Required (array)
featured: true                     # Optional (boolean)
image: "/blog/image.png"          # Optional
canonical: "https://..."          # Optional
---

Features You Get For Free

Automatic Features

  • Read time calculation: Based on word count (200 words/min)
  • Date formatting: Converts to "October 25, 2025" format
  • Slug generation: Filename becomes URL slug
  • Sorting: Newest posts first
  • Tag filtering: All tags extracted automatically

UI Features

  • Beautiful card layout on listing page
  • Featured post badges
  • Author avatars
  • View counts (placeholder)
  • Comment counts (placeholder)
  • Responsive design
  • Dark mode support

Testing This Post

Visit these URLs:

  1. Listing page: http://localhost:8668/en/blog

    • You should see this post at the top (it's dated today and featured)
  2. Individual post: http://localhost:8668/en/blog/test-new-blog-post

    • Full post with all styling

Adding Your Real Blog Post

Just copy this structure:

# Create new file
touch app/[locale]/blog/your-post-slug.mdx

Add frontmatter and content:

---
title: "Your Awesome Post Title"
description: "What your post is about"
author: "Your Name"
date: "2025-10-25"
tags: ["Relevant", "Tags"]
featured: false
---

# Your Content Here

Write your amazing content...

Save the file, and it instantly appears on your blog!

Optional: Update Meta

If you want to keep _meta.json in sync for Nextra:

npm run generate-blog-meta

This updates the metadata file automatically.

Cleanup

When you're done testing this demo post, just delete this file:

rm app/[locale]/blog/test-new-blog-post.mdx

The blog will automatically update and remove it from the listing.

Summary

Question: Will adding a new blog be as simple as creating a new MDX file?

Answer: YES!

  • Create MDX file → Blog post appears
  • No database updates needed
  • No config file changes needed
  • No manual registration needed
  • Completely automatic

This test post demonstrates the automatic blog system. Feel free to delete it when you're satisfied it works!

Was this article helpful?

Your feedback helps us improve our content.

Join the conversation

24 reactions

Share your thoughts, ask questions, or discuss this article with other readers.

Comments are coming soon. In the meantime, email us at hello@pupam.com with your thoughts.
G

GitHub Copilot

Passionate about email automation and helping teams work more efficiently. Follow me for more insights on productivity and modern communication tools.

Stay updated with our latest articles

Join thousands of readers who get our best content delivered directly to their inbox every week.

No spam. Unsubscribe anytime.

Ready to transform your email workflow?

Join thousands of teams already using Pupam to streamline their communications.

Get Started Free
Đăng ký mua Tên miền, Tên miền, Cho thuê Hosting, Máy chủ, VPS, Email chuyên nghiệp, Chữ ký số Mắt Bão - CA