mirror of
https://github.com/svemagie/blog-eleventy-indiekit.git
synced 2026-05-15 06:58:50 +02:00
fix: recent-posts widget fallback to collections.recentPosts
The widget used bare 'recentPosts' variable which doesn't exist in the homepage context (it's a collection). Add fallback to collections.recentPosts so the widget works on all pages.
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
{# Recent Posts Widget (sidebar) - compact type-aware list #}
|
{# Recent Posts Widget (sidebar) - compact type-aware list #}
|
||||||
|
{% set recentPosts = recentPosts or collections.recentPosts %}
|
||||||
{% if recentPosts and recentPosts.length %}
|
{% if recentPosts and recentPosts.length %}
|
||||||
<is-land on:visible>
|
<is-land on:visible>
|
||||||
<div class="widget">
|
<div class="widget">
|
||||||
|
|||||||
Reference in New Issue
Block a user