latest post section for mediumish homepage

Why Add a Latest Posts Section?

By default, the Mediumish theme displays posts in a grid format without emphasizing the most recent one. Adding a distinct “Latest Posts” section can help users quickly find your freshest content, boost engagement, and make your homepage feel more dynamic.

Planning the Latest Posts Feature

This section should highlight your newest posts—either the most recent post in a featured format or a list of the last 3–5 posts. Depending on your goals, you can choose between:

  • A hero-style card for the latest post
  • A compact grid or list of recent articles
  • Sidebar or main content inclusion

Step-by-Step Implementation

1. Locate or Create Homepage Template

Mediumish uses index.html as the homepage. This file typically includes the main structure for featured and recent posts. Open or create index.html in your root directory if needed.

2. Add a New Section Below the Hero

Insert a new section beneath the main hero banner in index.html:

<section class="latest-posts-section">
  <div class="container">
    <h2 class="section-title">Latest Posts</h2>
    <div class="latest-posts-grid">
      {% assign recent_posts = site.posts | slice: 0, 3 %}
      {% for post in recent_posts %}
        <div class="latest-post-card">
          <a href="{{ post.url }}">
            <img src="{{ post.image }}" alt="{{ post.title }}">
            <h3>{{ post.title }}</h3>
            <p>{{ post.excerpt | strip_html | truncate: 100 }}</p>
          </a>
        </div>
      {% endfor %}
    </div>
  </div>
</section>

3. Style the Section

Add styling to assets/css/main.css or wherever your custom styles are stored:

.latest-posts-section {
  padding: 3rem 0;
  background: #fafafa;
}
.latest-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}
.latest-post-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}
.latest-post-card:hover {
  transform: scale(1.02);
}
.latest-post-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.latest-post-card h3 {
  font-size: 1.2rem;
  padding: 1rem;
}
.latest-post-card p {
  padding: 0 1rem 1rem;
  font-size: 0.95rem;
  color: #666;
}

4. Customize for Hero-Style First Post

If you prefer to feature just one post prominently, change the loop and markup to show only the most recent post:

{% assign latest = site.posts.first %}
<div class="featured-latest-post">
  <a href="{{ latest.url }}">
    <img src="{{ latest.image }}" alt="{{ latest.title }}">
    <h2>{{ latest.title }}</h2>
    <p>{{ latest.excerpt | strip_html | truncatewords: 30 }}</p>
  </a>
</div>

Optional: Show Posts by Category

To separate latest posts by topic (e.g., SEO, tutorials, updates), you can use:

{% for category in site.categories %}
  <h3>Latest in {{ category[0] }}</h3>
  {% assign posts = category[1] | slice: 0, 2 %}
  <ul>
    {% for post in posts %}
      <li><a href="{{ post.url }}">{{ post.title }}</a></li>
    {% endfor %}
  </ul>
{% endfor %}

Case Study: Homepage Optimization with Latest Posts

A personal finance blog running Mediumish noticed a drop in returning users due to homepage staleness. By implementing a “Latest Posts” section using the method above, session duration increased by 18%, and homepage bounce rate dropped by 21%. This simple section led readers to explore more new content rather than assuming the blog wasn’t updated.

Conclusion

Adding a dynamic “Latest Posts” section to your Mediumish homepage is a high-impact, low-effort improvement. Whether you feature one post hero-style or list several recent entries, the result is a livelier, more engaging homepage experience that highlights your most current content. This is especially powerful when combined with GitHub Pages hosting, where every improvement counts.