Search Posts

General

How Featured Posts Work in This Blog

Learn how to make a post featured, how featured posts are displayed, and how to customize the featured section in this Next.js markdown blog.

How Featured Posts Work in This Blog

This blog template supports featured posts to help you highlight important or popular content at the top of your homepage.

How to Feature a Post

To make a post featured:

  1. Open the markdown file for your post in content/posts/.

  2. In the frontmatter (the section at the top between ---), add or set:

    featured: true
    

    Example:

    ---
    title: "My Awesome Post"
    slug: "my-awesome-post"
    date: "2025-05-17"
    category: "general"
    published: true
    featured: true
    tags:
      - "Feature"
      - "Guide"
      - "Highlights"
    coverImage: "/images/dark-placeholder.svg"
    excerpt: "A quick intro to featured posts."
    ---
    
  3. Save the file. The post will now be treated as featured.

Tags & Metadata

  • You can also add any frontmatter tags to featured posts. These will appear in the post’s tag cloud below the content.
  • Additionally, excerpt and coverImage fields can be customized for improved SEO and appearance.

Where Are Featured Posts Shown?

  • Homepage:
    • If you have one featured post, it appears in a large card at the top.
    • If you have multiple featured posts, they appear in a slider/carousel at the top.
  • Blog List:
    • Featured posts are visually highlighted and may appear before regular posts, depending on your configuration.

How It Works Under the Hood

  • The homepage (app/page.tsx) filters posts with featured: true in their frontmatter.
  • The FeaturedPost and FeaturedPostSlider components in components/blog/ handle the display.
  • You can customize the look and behavior by editing these components.

Tips

  • Use featured posts to highlight launches, guides, or important updates.
  • You can have as many featured posts as you like.
  • If no posts are featured, the homepage will simply show the latest posts.

For more details, see the code in app/page.tsx and the components in components/blog/.