From dc8762b4279820a9c55d2f69ed42c31d58bce63d Mon Sep 17 00:00:00 2001 From: Ricardo Date: Fri, 6 Mar 2026 15:07:15 +0100 Subject: [PATCH] fix: register ai-usage widget in sidebar.njk and add zap icon The ai-usage widget was empty on blog listing pages (/notes/, /photos/) because sidebar.njk (the third sidebar dispatcher) was missing the widget registration. Also adds the "zap" lightning bolt icon to icon.njk which was referenced but never defined. Confab-Link: http://localhost:8080/sessions/edb1b7b0-da66-4486-bd9c-d1cfa7553b88 --- _includes/components/icon.njk | 2 ++ _includes/components/sidebar.njk | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/_includes/components/icon.njk b/_includes/components/icon.njk index d538ddd..69c0036 100644 --- a/_includes/components/icon.njk +++ b/_includes/components/icon.njk @@ -61,6 +61,8 @@ {%- elif name == "user-plus" -%} +{%- elif name == "zap" -%} + {%- else -%} {%- endif -%} diff --git a/_includes/components/sidebar.njk b/_includes/components/sidebar.njk index a6378eb..dfe3cf6 100644 --- a/_includes/components/sidebar.njk +++ b/_includes/components/sidebar.njk @@ -22,6 +22,7 @@ {% elif widget.type == "author-card" %}{% set widgetTitle = "Author" %} {% elif widget.type == "author-card-compact" %}{% set widgetTitle = "Author" %} {% elif widget.type == "subscribe" %}{% set widgetTitle = "Subscribe" %} + {% elif widget.type == "ai-usage" %}{% set widgetTitle = "AI Transparency" %} {% elif widget.type == "custom-html" %}{% set widgetTitle = (widget.config.title if widget.config and widget.config.title) or "Custom" %} {% else %}{% set widgetTitle = widget.type %} {% endif %} @@ -53,6 +54,8 @@ {% set widgetIcon = "search" %}{% set widgetIconClass = "w-5 h-5 text-surface-500" %}{% set widgetBorder = "" %} {% elif widget.type == "webmentions" %} {% set widgetIcon = "share" %}{% set widgetIconClass = "w-5 h-5 text-surface-500" %}{% set widgetBorder = "" %} + {% elif widget.type == "ai-usage" %} + {% set widgetIcon = "zap" %}{% set widgetIconClass = "w-5 h-5 text-amber-500" %}{% set widgetBorder = "border-l-[3px] border-l-amber-400 dark:border-l-amber-500" %} {% else %} {% set widgetIcon = "" %}{% set widgetIconClass = "" %}{% set widgetBorder = "" %} {% endif %} @@ -125,6 +128,8 @@ {% include "components/widgets/webmentions.njk" %} {% elif widget.type == "fediverse-follow" %} {% include "components/widgets/fediverse-follow.njk" %} + {% elif widget.type == "ai-usage" %} + {% include "components/widgets/ai-usage.njk" ignore missing %} {% elif widget.type == "custom-html" %} {% set wConfig = widget.config or {} %}