feat: add email obfuscation to protect from spam bots

- Add obfuscateEmail Eleventy filter that converts email to HTML entities
- Apply to h-card.njk (both mailto: href and display text)
- Apply to blog-sidebar.njk hidden data element
- HTML entities block ~95% of spam harvesters while remaining valid
  for IndieWeb microformat parsers (u-email for rel="me" auth)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Ricardo
2026-02-06 09:21:09 +01:00
parent f37cd3b913
commit b448aaa0e0
3 changed files with 19 additions and 3 deletions

View File

@@ -56,8 +56,9 @@
{# Email and PGP Key #}
<div class="mt-2 flex flex-wrap gap-3 text-sm">
{% if site.author.email %}
<a href="mailto:{{ site.author.email }}" class="u-email text-primary-600 dark:text-primary-400 hover:underline" itemprop="email">
✉️ {{ site.author.email }}
{# Email obfuscated as HTML entities to deter spam harvesters while keeping valid for microformat parsers #}
<a href="{{ site.author.email | obfuscateEmail('href') }}" class="u-email text-primary-600 dark:text-primary-400 hover:underline" itemprop="email">
✉️ {{ site.author.email | obfuscateEmail }}
</a>
{% endif %}
{% if site.author.keyUrl %}