Blog › Jekyll

Adding series banners and descriptions to Chirpy category pages

Turn Jekyll Chirpy category pages into series hubs with banners, Markdown descriptions, and chronological sorting using _data YAML files and a layout override.

Adding series banners and descriptions to Chirpy category pages

Jekyll Chirpy’s default category page only renders a folder icon, post count, and reverse-chronological list of titles. When you publish multi-part series, readers landing on a category page need context—what the series covers, where to start, and any related project links. This post shows how to turn Chirpy category pages into data-driven series hubs using _data/ YAML files and a layout override.

Verified with Jekyll 4.x and jekyll-theme-chirpy v7.x.


Why turn category pages into series hubs

For standalone notes, a plain chronological list works fine. Once I began publishing multi-part series—such as backend challenge write-ups or Spring Boot implementation guides—the default category page felt bare:

  • First-time visitors landing on a category from search had no summary of what the series was about.
  • Posts appeared newest-first by default, forcing readers to scroll to the bottom to find Part 1.
  • Hardcoding HTML banners into a layout template does not scale once you maintain more than two or three categories.

Jekyll’s built-in Data Files (_data/) solve the maintenance problem cleanly. By placing one YAML file per featured category under _data/tags/ and reading site.data.tags[page.title] inside _layouts/category.html, adding a new series banner takes a single YAML file with zero template edits.

flowchart TD
    A["Category page request"] --> B["_layouts/category.html"]
    B --> C{"_data/tags/*.yaml exists?"}
    C -->|"Yes"| D["Render banner + description box"]
    C -->|"No"| E["Render default header only"]
    D --> F["Chronological post list"]
    E --> F

When not to customize category layouts

If your blog has only a handful of broad categories (Backend, Notes) with unrelated one-off posts, reversing the sort order to oldest-first hurts discoverability—readers expect the newest posts at the top. In that case, apply chronological sorting only when a series metadata file exists ({% if tag %}), and keep reverse-chronological order for general categories.


Step 1: Design the metadata schema (_data/tags/*.yaml)

Jekyll automatically parses every YAML and JSON file inside _data/ and exposes it under the global site.data object. To keep each category’s metadata isolated, create a _data/tags/ directory and name each file to match the category’s exact title:

1
2
3
4
_data/
└── tags/
    ├── wanted-be-challenge.yaml
    └── spring-boot.yaml

Here is a real example I used for a backend engineering challenge series (the Wanted Pre-Onboarding Backend Challenge in Korea):

1
2
3
4
5
6
7
8
9
10
11
12
# _data/tags/wanted-be-challenge.yaml
name: Wanted BE Challenge
link: "https://www.wanted.co.kr/events/pre_challenge_be_22"
thumbnail:
  path: "/assets/images/2025-03-11/wanted-banner.png"
  alt: "Wanted Pre-Onboarding Backend Challenge banner"
description: |
  ### Pre-Onboarding Backend Challenge

  Engineering notes and implementation write-ups from the Pre-Onboarding Backend Challenge pre-assignment.

  Instead of stopping at basic CRUD endpoints, this series covers domain modeling, unit testing, and integration testing against concrete requirements.

Each field maps cleanly to a section of the hub header:

  • name: Display label for the series.
  • link: Optional external reference URL (official event page, GitHub repo, or documentation).
  • thumbnail: Banner image path (prefer a local /assets/images/... path over external hotlinks) and alt text.
  • description: Multi-line Markdown block using YAML’s literal scalar (|) so headings and paragraph breaks survive parsing intact.

Step 2: Override _layouts/category.html

Because Chirpy is installed as a gem, creating _layouts/category.html in your repository root overrides the theme’s built-in category layout without touching gem internals.

Inside the template, look up site.data.tags[page.title]. When a matching YAML file exists, render the banner, Markdown description, and external link above the post list:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!-- _layouts/category.html -->
---
layout: page
# The Category layout
---

{% include lang.html %}

<div id="page-category">
  <h1 class="ps-lg-2">
    <i class="far fa-folder-open fa-fw text-muted"></i>
    {{ page.title }}
    <span class="lead text-muted ps-2">{{ page.posts | size }}</span>
  </h1>

  {% assign tag = site.data.tags[page.title] %}
  {% if tag %}
    <div class="tag-info py-1 px-3">
      {% if tag.thumbnail %}
        <div class="mt-3 mb-3">
          <img class="preview-img" src="{{ tag.thumbnail.path }}" alt="{{ tag.thumbnail.alt }}">
        </div>
      {% endif %}
      {% if tag.description %}
        <div class="tag-description">{{ tag.description | markdownify }}</div>
      {% endif %}
      {% if tag.link %}
        <a href="{{ tag.link }}" target="_blank" rel="noopener noreferrer">Learn More</a>
      {% endif %}
    </div>
  {% endif %}

  <ul class="content ps-0">
    {% assign sorted_posts = page.posts | sort: "date" %}
    {% for post in sorted_posts %}
      <li class="d-flex justify-content-between px-md-3">
        <a href="{{ post.url | relative_url }}">{{ post.title }}</a>
        <span class="dash flex-grow-1"></span>
        {% include datetime.html date=post.date class='text-muted small text-nowrap' lang=lang %}
      </li>
    {% endfor %}
  </ul>
</div>

Three Liquid details make this layout work cleanly:

  1. Graceful fallback: When no YAML file matches page.title, tag evaluates to nil and the entire .tag-info block is skipped.
  2. markdownify filter: {{ tag.description | markdownify }} runs Jekyll’s Kramdown parser on the YAML string, turning ### headings, lists, and inline links into proper HTML.
  3. Chronological ordering (sort: "date"): Sorting ascending lets readers work through a multi-part series from Part 1 onward instead of reading backwards.

Step 3: Add responsive styling and verify the output

Add a few rules to assets/css/jekyll-theme-chirpy.scss (the official SCSS override file in Chirpy v7+, as covered in my TOC customization post) so banner images scale down cleanly on mobile screens:

1
2
3
4
5
6
7
8
9
10
11
12
// assets/css/jekyll-theme-chirpy.scss
.tag-info .preview-img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.tag-description {
  margin-top: 1rem;
  line-height: 1.6;
}

Inspecting the rendered pages

Run bundle exec jekyll serve --livereload and check both a category with metadata and one without:

Customized category page displaying the challenge banner and Markdown description Figure 1. Category page rendered as a series hub with a top banner, Markdown summary, and chronological post list.

Close-up of the category banner and description box Figure 2. Banner image, rendered Markdown heading, and external reference link above the post list.

Default category page without a YAML metadata file Figure 3. A standard category without a _data/tags/ file falls back cleanly to Chirpy’s default layout.


Caveats and checklist

Key lookup is case-sensitive. site.data.tags[page.title] looks up the YAML filename stem verbatim. If your category name contains spaces or uppercase letters (such as Spring Boot), either normalize the key with page.title | slugify in Liquid ({% assign key = page.title | slugify %}) or match the filename casing exactly.

Host banner images locally. External event banners often expire after an event ends and break htmlproofer or leave dead <img> elements. Copy banner assets into assets/images/YYYY-MM-DD/ so they stay under version control and load from your CDN.

  • Watch Chirpy theme upgrades: Overriding _layouts/category.html means you own that template file. Whenever you bump jekyll-theme-chirpy, diff your override against the gem’s upstream _layouts/category.html so you don’t miss accessibility or class-name updates.
  • Escape Liquid examples in posts: If you document Liquid snippets in your own blog posts, wrap them in Liquid raw / endraw tags so Jekyll doesn’t evaluate them during build.

Verification checklist

  • YAML metadata file placed in _data/tags/ matching the category key (or slugify lookup applied)
  • _layouts/category.html overrides the default layout and falls back cleanly when metadata is absent
  • Banner styles appended to assets/css/jekyll-theme-chirpy.scss and checked on mobile widths
  • Both featured and non-featured category pages verified in bundle exec jekyll serve

References

In addition to the built-in variables available from Jekyll, you can specify your own custom data that can be accessed via the Liquid templating system.
All of the standard Liquid filters are supported (see below).
A minimal, responsive, and feature-rich Jekyll theme for technical writing. - cotes2020/jekyll-theme-chirpy
This post is licensed under CC BY 4.0 by the author.