mirror of
https://github.com/svemagie/blog-eleventy-indiekit.git
synced 2026-04-02 16:44:56 +02:00
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:
@@ -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 %}
|
||||
|
||||
Reference in New Issue
Block a user