Autolink emails for your Jekyll site.
Add to your Gemfile
:
gem 'jekyll-autolink_email'
Add to your _config.yml
:
gems:
- jekyll-autolink_email
In any html page or post, emails will be autolinked. So if you write [email protected]
, the resulting html will be <a href="mailto:[email protected]">[email protected]</a>
Autolinking is done by Rinku so visit that gem for a more in-depth explanation of the configuration options:
autolink_email:
link_attr: class='email-link' # attributes to add to the link
skip_tags: ['div'] # tags to skip
Jekyll::AutolinkEmail also provides a escape: true
option. Turning this on will html encode the email address and url encode the link to prevent spam.
- Fork it ( https://github.com/ivantsepp/jekyll-autolink_email/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
You should also check out Jemoji and Jekyll Mentions as those gems were the source of inspiration for this gem.