Files
indiekit-blog/_includes/components/widgets/fediverse-follow.njk
Ricardo e236b4bf65 a11y: comprehensive WCAG 2.1 Level AA accessibility audit
- Add skip-to-main-content link and main content ID target
- Add prefers-reduced-motion media queries for all animations
- Enhance visible focus indicators (2px offset, high-contrast ring)
- Replace ~160 text-surface-500 instances with text-surface-600/dark:text-surface-400
  for 4.5:1+ contrast ratio compliance
- Add aria-hidden="true" to ~30+ decorative SVG icons across sidebars/widgets
- Convert facepile containers from div to semantic ul/li with role="list"
- Add aria-label to icon-only buttons (share, sort controls)
- Add sr-only labels to form inputs (webmention, search)
- Add aria-live="polite" to dynamically loaded webmentions
- Add aria-label with relative+absolute date to time-difference component
- Add keyboard handlers (Enter/Space) to custom interactive elements
- Add aria-label to nav landmarks (table of contents)
- Fix modal focus trap and dialog accessibility
- Fix lightbox keyboard navigation and screen reader announcements

Confab-Link: http://localhost:8080/sessions/edb1b7b0-da66-4486-bd9c-d1cfa7553b88
2026-03-07 18:58:08 +01:00

37 lines
1.7 KiB
Plaintext

{# Fediverse Follow Me Widget — uses the fediverseInteract Alpine.js component #}
{# Requires fediverse-interact.js loaded in base.njk (already present) #}
{# Determines actor URI from site social links: prefers self-hosted AP, falls back to Mastodon #}
{% set actorUrl = "" %}
{% for link in site.social %}
{% if link.icon == "activitypub" and not actorUrl %}
{% set actorUrl = link.url %}
{% endif %}
{% endfor %}
{% if not actorUrl %}
{% for link in site.social %}
{% if link.icon == "mastodon" and not actorUrl %}
{% set actorUrl = link.url %}
{% endif %}
{% endfor %}
{% endif %}
{% if actorUrl %}
<is-land on:visible>
<div class="widget" x-data="fediverseInteract('{{ actorUrl }}', 'interact')">
<h3 class="widget-title">Follow Me</h3>
<p class="text-sm text-surface-600 dark:text-surface-400 mb-3">Follow me from your fediverse instance.</p>
<a href="{{ actorUrl }}"
@click="handleClick($event)"
class="inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-[#a730b8]/10 text-[#a730b8] hover:bg-[#a730b8]/20 transition-colors text-sm font-medium cursor-pointer"
title="Follow from your fediverse instance (Shift+click to change)">
<svg class="w-4 h-4" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M13.09 4.43L24 10.73v2.51L13.09 19.58v-2.51L21.83 12 13.09 6.98v-2.55zM13.09 9.49L17.44 12l-4.35 2.51V9.49z"/><path d="M10.91 4.43L0 10.73v2.51l8.74-5.03v10.09l2.18 1.28V4.43zM6.56 12L2.18 14.51l4.35 2.51V12z"/></svg>
<span>Follow on the Fediverse</span>
</a>
{% set modalTitle = "Follow on the Fediverse" %}
{% set modalDescription = "Choose your instance to follow this account." %}
{% include "components/fediverse-modal.njk" %}
</div>
</is-land>
{% endif %}