Skip to content

Commit db28b95

Browse files
committed
feat(security): Enhance email obfuscation
- Install and enable 'jekyll-email-protect' plugin - Configure plugin in _config.yml (plugins and whitelist) - Obfuscate email in _includes/sidebar.html using encode_email filter in addition to the existing JavaScript-based method for mailto link Rationale: mitigate email scraping by spam bots while preserving user experience. Scope: no UI changes beyond obfuscated mailto; build requires bundler to include the new gem.
1 parent 358a852 commit db28b95

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ gem "wdm", "~> 0.2.0", :platforms => [:mingw, :x64_mingw, :mswin]
1616
group :jekyll_plugins do
1717
gem 'jekyll-polyglot'
1818
gem 'jekyll-redirect-from'
19+
gem 'jekyll-email-protect'
1920
end

_config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,11 @@ jekyll-archives:
266266
category: /categories/:name/
267267

268268
plugins:
269+
- jekyll-polyglot
269270
- jekyll-redirect-from
271+
- jekyll-email-protect
270272

271273
whitelist:
274+
- jekyll-polyglot
272275
- jekyll-redirect-from
276+
- jekyll-email-protect

_includes/sidebar.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@
6363
https://{{ entry.type }}.com/{{ site[entry.type].username }}
6464
{%- endcapture -%}
6565
{% when 'email' %}
66-
{% assign email = site.social.email | split: '@' %}
66+
{% assign obfs_email = site.social.email | encode_email | split: '@' %}
6767
{%- capture url -%}
68-
javascript:location.href = 'mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@')
68+
javascript:location.href = 'mailto:' + ['{{ obfs_email[0] }}','{{ obfs_email[1] }}'].join('@')
6969
{%- endcapture -%}
7070
{% when 'rss' %}
7171
{% assign url = '/feed.xml' | relative_url %}

0 commit comments

Comments
 (0)