Liquid in layout working everywhere except posts

Working on building my blog and I have this in my sidebar on every page to show my most recent mini blog post:

---
cardName: Navigation
---

{% assign mini = "mini" %}

{% for post in site.posts | where: "type", mini limit:1 %}

*{{ post.date | date_to_string}}*

### [{{ post.title }}]({{ post.url }})

{{ post.excerpt }}

{% endfor %}

This is working literally everywhere on my site except post pages specifically. I suspect it has something to do with path relativity as I dealt with a similar issue (missing /) before since post/paths/are/different but I can’t figure out where the issue is coming from on this one. Anyone know how to fix this?