fix: restrict AI usage disclosure to articles and notes only

- post.njk: wrap <details> block in {% if '/articles/' in page.url
  or '/notes/' in page.url %} — hides it on photos, bookmarks,
  likes, replies, reposts
- page.njk: remove AI usage <aside> block entirely — pages are
  never article/note types

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
svemagie
2026-03-10 10:01:52 +01:00
parent df5bbe50d9
commit ea00bc2c0d
2 changed files with 3 additions and 44 deletions
-43
View File
@@ -83,49 +83,6 @@ withSidebar: true
</section> </section>
{% endif %} {% endif %}
{# AI usage disclosure #}
{% if aiTextLevel or aiCodeLevel or aiTools %}
<aside class="mt-6 p-4 rounded-lg bg-surface-50 dark:bg-surface-800/50 border border-surface-200 dark:border-surface-700 shadow-sm">
<div class="flex items-center gap-2 mb-2">
<svg class="w-4 h-4 text-surface-600 dark:text-surface-400 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.75 3.104v5.714a2.25 2.25 0 01-.659 1.591L5 14.5M9.75 3.104c-.251.023-.501.05-.75.082m.75-.082a24.301 24.301 0 014.5 0m0 0v5.714a2.25 2.25 0 00.659 1.591L19 14.5M14.25 3.104c.251.023.501.05.75.082M19 14.5l-2.47 2.47a2.25 2.25 0 01-1.59.659H9.06a2.25 2.25 0 01-1.591-.659L5 14.5m14 0V17a2 2 0 01-2 2H7a2 2 0 01-2-2v-2.5"/>
</svg>
<strong class="text-sm font-semibold text-surface-700 dark:text-surface-300">AI Usage</strong>
</div>
<div class="flex flex-wrap gap-3 text-xs text-surface-600 dark:text-surface-400">
{% if aiTextLevel %}
<span class="inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-surface-100 dark:bg-surface-700">
Text: {% if aiTextLevel === "0" %}None{% elif aiTextLevel === "1" %}Editorial{% elif aiTextLevel === "2" %}Co-drafted{% elif aiTextLevel === "3" %}AI-generated{% endif %}
</span>
{% endif %}
{% if aiCodeLevel %}
<span class="inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-surface-100 dark:bg-surface-700">
Code: {% if aiCodeLevel === "0" %}Human{% elif aiCodeLevel === "1" %}AI-assisted{% elif aiCodeLevel === "2" %}AI-generated{% endif %}
</span>
{% endif %}
{% if aiTools %}
<span class="inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-surface-100 dark:bg-surface-700">
Tools: {{ aiTools }}
</span>
{% endif %}
</div>
{% if aiDescription %}
<p class="mt-2 text-xs text-surface-600 dark:text-surface-400">{{ aiDescription }}</p>
{% endif %}
<p class="mt-2 text-xs"><a href="/ai/" class="text-accent-600 dark:text-accent-400 hover:underline">Learn more about AI usage on this site &rarr;</a></p>
<div class="hidden">
<span class="p-ai-text-level">{{ aiTextLevel }}</span>
<span class="p-ai-code-level">{{ aiCodeLevel or "0" }}</span>
{% if aiTools %}
<span class="p-ai-tools">{{ aiTools }}</span>
{% endif %}
{% if aiDescription %}
<span class="e-ai-description">{{ aiDescription }}</span>
{% endif %}
</div>
</aside>
{% endif %}
{# Categories/tags if present #} {# Categories/tags if present #}
{% if category %} {% if category %}
<footer class="mt-8 pt-6 border-t border-surface-200 dark:border-surface-700"> <footer class="mt-8 pt-6 border-t border-surface-200 dark:border-surface-700">
+3 -1
View File
@@ -76,7 +76,8 @@ withBlogSidebar: true
{# Rich reply context with h-cite microformat #} {# Rich reply context with h-cite microformat #}
{% include "components/reply-context.njk" %} {% include "components/reply-context.njk" %}
{# AI usage disclosure — always shown, collapsed by default, placed after reply context #} {# AI usage disclosure — articles and notes only #}
{% if '/articles/' in page.url or '/notes/' in page.url %}
<details class="mt-4 text-xs text-surface-600 dark:text-surface-400"> <details class="mt-4 text-xs text-surface-600 dark:text-surface-400">
<summary class="cursor-pointer hover:text-surface-600 dark:hover:text-surface-300 list-none flex items-center gap-1.5 [&::-webkit-details-marker]:hidden"> <summary class="cursor-pointer hover:text-surface-600 dark:hover:text-surface-300 list-none flex items-center gap-1.5 [&::-webkit-details-marker]:hidden">
<svg class="w-3.5 h-3.5 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true"> <svg class="w-3.5 h-3.5 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
@@ -101,6 +102,7 @@ withBlogSidebar: true
{% endif %} {% endif %}
</div> </div>
</details> </details>
{% endif %}
{# Pending syndication targets (for services like IndieNews that require u-syndication before webmention) #} {# Pending syndication targets (for services like IndieNews that require u-syndication before webmention) #}
{% if mpSyndicateTo %} {% if mpSyndicateTo %}