fix: pagination scrambling and scroll + feat: excludePostTypes filter

- Fix duplicate x-for keys causing scrambled pagination numbers on
  interactions page (two '…' entries shared the same key)
- Fix scroll target in goToPage — was using dead closest('[x-show]')
  selector, now scrolls to #webmentions-list
- Add flex-wrap to pagination-links for mobile overflow
- Add excludePostTypes Eleventy filter to exclude post types from
  collections by detecting type from frontmatter properties
- Wire excludePostTypes into recent-posts section via sectionConfig
- Add error/stale data banner to changelog page
This commit is contained in:
Ricardo
2026-03-26 16:25:36 +01:00
parent a3cb1c1f55
commit 8af3cc329d
4 changed files with 39 additions and 8 deletions

View File

@@ -7,15 +7,17 @@
{% set sectionConfig = section.config or {} %}
{% set maxItems = sectionConfig.maxItems or 5 %}
{% set showSummary = sectionConfig.showSummary if sectionConfig.showSummary is defined else true %}
{% set excludeTypes = sectionConfig.excludeTypes or [] %}
{% set recentPosts = collections.posts | excludePostTypes(excludeTypes) | head(maxItems) %}
{% if collections.posts and collections.posts.length %}
{% if recentPosts and recentPosts.length %}
<section class="mb-8 sm:mb-12">
<h2 class="text-xl sm:text-2xl font-bold text-surface-900 dark:text-surface-100 mb-4 sm:mb-6">
{{ sectionConfig.title or "Recent Posts" }}
</h2>
<div class="space-y-4">
{% for post in collections.posts | head(maxItems) %}
{% for post in recentPosts %}
{# Detect post type from frontmatter properties #}
{% set likedUrl = post.data.likeOf or post.data.like_of %}
{% set bookmarkedUrl = post.data.bookmarkOf or post.data.bookmark_of %}