Skip to content

Commit 7ff2b67

Browse files
fix(observability): use exact slug path matching to prevent substring collisions
Git-Session-Id: 55aba88a-b4a8-42a6-95f2-84f564c0dcc1
1 parent 9adfa41 commit 7ff2b67

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎observability.pug‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ main.container.mx-auto.px-4.py-8
4242
.grid.gap-4
4343
| {% for slug in anchor_slugs %}
4444
| {% assign matched_post = nil %}
45+
| {% assign slug_path = '/' | append: slug | append: '/' %}
4546
| {% for post in site.posts %}
46-
| {% if post.url contains slug %}
47+
| {% if post.url contains slug_path %}
4748
| {% assign matched_post = post %}
49+
| {% break %}
4850
| {% endif %}
4951
| {% endfor %}
5052
| {% if matched_post %}

0 commit comments

Comments
 (0)