aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB Mathis <brandon@imathis.com>2009-11-12 12:03:34 -0600
committerB Mathis <brandon@imathis.com>2009-11-12 12:03:34 -0600
commit4d1e6d414c7dc1a71ed98af7ad106158c7b99657 (patch)
treeeb8628e297c16cb5b8059033d1c23e93226777de
parenta55a55156638efd574b7d78f57da0955f355ba40 (diff)
downloadmy_new_personal_website-4d1e6d414c7dc1a71ed98af7ad106158c7b99657.tar.xz
my_new_personal_website-4d1e6d414c7dc1a71ed98af7ad106158c7b99657.zip
added email obfusticator to the helpers, use with #{to_html_email("user@domain.com")}
Diffstat (limited to '')
-rw-r--r--source/_helpers.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/_helpers.rb b/source/_helpers.rb
index f957d2a6..e7987dc5 100644
--- a/source/_helpers.rb
+++ b/source/_helpers.rb
@@ -156,6 +156,15 @@ module Helpers
# My added helpers
+ def to_html_email(address)
+ email = string_to_html(address)
+ "<a href=\"#{string_to_html('mailto:')}#{email}\">#{email}</a>"
+ end
+
+ def string_to_html(s)
+ s.strip.unpack("C*").map{|ch| "&#" + ch.to_s + ";" }.to_s
+ end
+
def show_part (file)
data = ''
f = File.open(Dir.pwd+"/source/"+file)