fix: make post-navigation and webmentions sidebar widgets functional

Post navigation now uses previousInCollection/nextInCollection filters
to find adjacent posts (avoids Nunjucks loop scoping bug). Webmentions
sidebar widget now uses webmentionsForUrl and webmentionsByType filters
instead of non-existent filter function.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ricardo
2026-02-13 08:53:35 +01:00
parent cf3586eadd
commit a4c121d203
3 changed files with 43 additions and 22 deletions

View File

@@ -1,5 +1,6 @@
{# Webmentions Widget (if this post has any) #}
{% if webmentions and webmentions.length %}
{# Webmentions Sidebar Widget (compact counts for this post) #}
{% set _mentions = webmentions | webmentionsForUrl(page.url, urlAliases) %}
{% if _mentions and _mentions.length %}
<div class="widget">
<h3 class="widget-title flex items-center gap-2">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
@@ -8,9 +9,9 @@
Interactions
</h3>
<div class="space-y-2">
{% set likes = webmentions | filter("like-of") %}
{% set reposts = webmentions | filter("repost-of") %}
{% set replies = webmentions | filter("in-reply-to") %}
{% set likes = _mentions | webmentionsByType("likes") %}
{% set reposts = _mentions | webmentionsByType("reposts") %}
{% set replies = _mentions | webmentionsByType("replies") %}
{% if likes.length %}
<p class="text-sm text-surface-600 dark:text-surface-400">