Add <is-land on:visible> lazy-loading wrapper to every widget template and the comments section for consistent deferred rendering. Widgets that already had it (social-activity, github-repos, blogroll, feedland, webmentions) are unchanged. Also wraps inline search and custom-html widgets in all sidebar container files.
92 lines
3.6 KiB
Plaintext
92 lines
3.6 KiB
Plaintext
{# Sidebar — for blog listing pages (/blog/, /notes/, /articles/...) #}
|
|
{# Data-driven when homepageConfig.blogListingSidebar is configured, otherwise falls back to default widgets #}
|
|
|
|
{% if homepageConfig and homepageConfig.blogListingSidebar and homepageConfig.blogListingSidebar.length %}
|
|
{# === Data-driven mode: render configured widgets === #}
|
|
{% for widget in homepageConfig.blogListingSidebar %}
|
|
{% if widget.type == "author-card" %}
|
|
{% include "components/widgets/author-card.njk" %}
|
|
{% elif widget.type == "author-card-compact" %}
|
|
{% include "components/widgets/author-card-compact.njk" %}
|
|
{% elif widget.type == "social-activity" %}
|
|
{% include "components/widgets/social-activity.njk" %}
|
|
{% elif widget.type == "github-repos" %}
|
|
{% include "components/widgets/github-repos.njk" %}
|
|
{% elif widget.type == "funkwhale" %}
|
|
{% include "components/widgets/funkwhale.njk" %}
|
|
{% elif widget.type == "recent-posts" %}
|
|
{% include "components/widgets/recent-posts.njk" %}
|
|
{% elif widget.type == "blogroll" %}
|
|
{% if blogrollStatus and blogrollStatus.source == "indiekit" %}
|
|
{% include "components/widgets/blogroll.njk" %}
|
|
{% endif %}
|
|
{% elif widget.type == "feedland" %}
|
|
{% include "components/widgets/feedland.njk" %}
|
|
{% elif widget.type == "categories" %}
|
|
{% include "components/widgets/categories.njk" %}
|
|
{% elif widget.type == "subscribe" %}
|
|
{% include "components/widgets/subscribe.njk" %}
|
|
{% elif widget.type == "recent-comments" %}
|
|
{% include "components/widgets/recent-comments.njk" %}
|
|
{% elif widget.type == "search" %}
|
|
<is-land on:visible>
|
|
<div class="widget">
|
|
<h3 class="widget-title">Search</h3>
|
|
<div id="listing-sidebar-search"></div>
|
|
<script>initPagefind("#listing-sidebar-search");</script>
|
|
</div>
|
|
</is-land>
|
|
{% elif widget.type == "webmentions" %}
|
|
{% include "components/widgets/webmentions.njk" %}
|
|
{% elif widget.type == "custom-html" %}
|
|
{% set wConfig = widget.config or {} %}
|
|
<is-land on:visible>
|
|
<div class="widget">
|
|
{% if wConfig.title %}
|
|
<h3 class="widget-title">{{ wConfig.title }}</h3>
|
|
{% endif %}
|
|
{% if wConfig.content %}
|
|
<div class="prose dark:prose-invert prose-sm max-w-none">
|
|
{{ wConfig.content | safe }}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</is-land>
|
|
{% else %}
|
|
<!-- Unknown widget type: {{ widget.type }} -->
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% else %}
|
|
{# === Fallback: current hardcoded sidebar (backward compatibility) === #}
|
|
{# Author Card (h-card) — always shown #}
|
|
{% include "components/widgets/author-card.njk" %}
|
|
|
|
{# Social Activity — Bluesky/Mastodon feeds #}
|
|
{% include "components/widgets/social-activity.njk" %}
|
|
|
|
{# GitHub Repos #}
|
|
{% include "components/widgets/github-repos.njk" %}
|
|
|
|
{# Funkwhale — Now Playing / Listening Stats #}
|
|
{% include "components/widgets/funkwhale.njk" %}
|
|
|
|
{# Recent Posts (for non-blog pages) #}
|
|
{% include "components/widgets/recent-posts.njk" %}
|
|
|
|
{# Blogroll — only when backend is available #}
|
|
{% if blogrollStatus and blogrollStatus.source == "indiekit" %}
|
|
{% include "components/widgets/blogroll.njk" %}
|
|
{% endif %}
|
|
|
|
{# FeedLand — only when backend is available #}
|
|
{% if blogrollStatus and blogrollStatus.source == "indiekit" %}
|
|
{% include "components/widgets/feedland.njk" %}
|
|
{% endif %}
|
|
|
|
{# Recent Comments #}
|
|
{% include "components/widgets/recent-comments.njk" %}
|
|
|
|
{# Categories/Tags #}
|
|
{% include "components/widgets/categories.njk" %}
|
|
{% endif %}
|