mirror of
https://github.com/svemagie/blog-eleventy-indiekit.git
synced 2026-04-02 16:44:56 +02:00
fix: don't obfuscate email in href/value attributes
HTML entities in href and value attributes don't decode properly - browsers treat them as literal strings. Only obfuscate display text. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
</div>
|
||||
{# Hidden but present for microformat completeness #}
|
||||
<p class="p-note hidden">{{ site.author.bio }}</p>
|
||||
{% if site.author.email %}<data class="u-email hidden" value="{{ site.author.email | obfuscateEmail }}"></data>{% endif %}
|
||||
{% if site.author.email %}<data class="u-email hidden" value="{{ site.author.email }}"></data>{% endif %}
|
||||
{% if site.author.org %}<data class="p-org hidden" value="{{ site.author.org }}"></data>{% endif %}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -56,8 +56,8 @@
|
||||
{# Email and PGP Key #}
|
||||
<div class="mt-2 flex flex-wrap gap-3 text-sm">
|
||||
{% if 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">
|
||||
{# Display text obfuscated to deter spam harvesters; href kept plain for browser compatibility #}
|
||||
<a href="mailto:{{ site.author.email }}" class="u-email text-primary-600 dark:text-primary-400 hover:underline" itemprop="email">
|
||||
✉️ {{ site.author.email | obfuscateEmail }}
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user