mirror of
https://github.com/svemagie/blog-eleventy-indiekit.git
synced 2026-04-02 16:44:56 +02:00
Fix recentPosts collection glob (content/posts/ → content/) so the widget actually finds posts. Extract blog-sidebar widgets into reusable partials. Make both sidebar.njk (listing pages) and blog-sidebar.njk (post pages) configurable via homepageConfig.blogListingSidebar and homepageConfig.blogPostSidebar, with fallback to current hardcoded widgets for backward compatibility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
33 lines
1.4 KiB
Plaintext
33 lines
1.4 KiB
Plaintext
{# Webmentions Widget (if this post has any) #}
|
|
{% if webmentions and webmentions.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">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"/>
|
|
</svg>
|
|
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") %}
|
|
|
|
{% if likes.length %}
|
|
<p class="text-sm text-surface-600 dark:text-surface-400">
|
|
<span class="font-medium text-surface-900 dark:text-surface-100">{{ likes.length }}</span> likes
|
|
</p>
|
|
{% endif %}
|
|
{% if reposts.length %}
|
|
<p class="text-sm text-surface-600 dark:text-surface-400">
|
|
<span class="font-medium text-surface-900 dark:text-surface-100">{{ reposts.length }}</span> reposts
|
|
</p>
|
|
{% endif %}
|
|
{% if replies.length %}
|
|
<p class="text-sm text-surface-600 dark:text-surface-400">
|
|
<span class="font-medium text-surface-900 dark:text-surface-100">{{ replies.length }}</span> replies
|
|
</p>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|