James Peret's blog. Built with Jekyll and the Mikey theme.
# _plugins/url_encode.rbrequire 'liquid'require 'uri'# Percent encoding for URI conforming to RFC 3986.# Ref: http://tools.ietf.org/html/rfc3986#page-12module URLEncode def url_encode(url) return URI.escape(url, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]")) endendLiquid::Template.register_filter(URLEncode)