Skip to content

Commit d77d9dc

Browse files
fix(observability): guard against nil tag before sort
site.tags["observability"] returns nil when no posts carry the tag, causing Liquid's sort filter to throw 'Cannot sort a null object.' and breaking the pre-commit Jekyll build. Guard with a nil check and fall back to an empty array. Broke the weekly gptme digest publish step (bob-weekly-gptme-digest.service). Git-Session-Id: 0e108269-aed7-406a-9942-c991b20ebdb0
1 parent e2fa327 commit d77d9dc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎observability.pug‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ main.container.mx-auto.px-4.py-8
6262
| {% endfor %}
6363

6464
//- All observability-tagged posts by date
65-
| {% assign obs_posts = site.tags["observability"] | sort: "date" | reverse %}
65+
| {% assign obs_posts_raw = site.tags["observability"] %}
66+
| {% if obs_posts_raw %}{% assign obs_posts = obs_posts_raw | sort: "date" | reverse %}{% else %}{% assign obs_posts = "" | split: "" %}{% endif %}
6667
.mb-4
6768
h2.text-lg.font-bold.mb-4.pb-2.border-b.border-border(class="text-text")
6869
| All posts

0 commit comments

Comments
 (0)