mirror of
https://github.com/svemagie/blog-eleventy-indiekit.git
synced 2026-05-15 06:58:50 +02:00
fix: wrap webmentions widget in is-land for lazy loading
The webmentions sidebar widget uses Alpine.js + fetch API but was missing the is-land on:visible wrapper that all other JS-dependent sidebar widgets have. This defers its initialization until scrolled into view, consistent with social-activity, github-repos, funkwhale, blogroll, and feedland widgets.
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
{# Recent Webmentions Widget - site-wide inbound/outbound activity #}
|
{# Recent Webmentions Widget - site-wide inbound/outbound activity #}
|
||||||
{# Uses client-side fetch from /webmentions/api/mentions (same as /interactions page) #}
|
{# Uses client-side fetch from /webmentions/api/mentions (same as /interactions page) #}
|
||||||
{# Outbound tab uses Eleventy collections (likes, replies, bookmarks, reposts) #}
|
{# Outbound tab uses Eleventy collections (likes, replies, bookmarks, reposts) #}
|
||||||
|
<is-land on:visible>
|
||||||
<div class="widget" x-data="webmentionsWidget()" x-init="init()">
|
<div class="widget" x-data="webmentionsWidget()" x-init="init()">
|
||||||
<h3 class="widget-title flex items-center gap-2">
|
<h3 class="widget-title flex items-center gap-2">
|
||||||
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
@@ -148,3 +149,4 @@ function webmentionsWidget() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
</is-land>
|
||||||
|
|||||||
Reference in New Issue
Block a user