jekyll-js-protect

jekyll-js-protect

Protect sensitive info in your Jekyll site from webscrapers and bots

🧧 jekyll-js-protect

Protect sensitive info (emails/phone numbers) on your Jekyll site from scrapers and bots.

🔴 Install

  1. Add jekyll-js-protect in your Gemfile like so
    gem 'jekyll-js-protect'
    
  2. Run bundle install

♦️ Usage

There are 3 Liquid Filters that this plugin exposes, string_protect, email_protect and tel_protect. email_protect and tel_protect will add mailto: and tel: links resepectively.

For other info (or if you don't want your email/number to be clickable) use the string_protect tag.

The markup below

Bots can't read this: {{'I like pineapples' | string_protect}}

My email address is {{'[email protected]' | email_protect}}

You can call me at {{'9999999999' | tel_protect}}

Renders:

image

📕 How it works

  • The input to the Filter is encoded in Base64 then prefixed with a code
  • A Jekyll Hook adds a tiny JS file to your pages
  • When the JS file loads it decodes the encoded info
  • Since webcrawlers used for collecting emails do not typically have a JS stack it protects against such bots

🧰 Misc

  • A <noscript> fallback is provided for when JS is disabled.
image
  • It is assumed that anyone who chooses to disable JS on their browser knows how to decode Base64 strings