Permalink
Browse files

Tear out the Liquid filters I added since I now have Haml helpers.

  • Loading branch information...
1 parent 8870dde commit c0e96dd4746f5a8d5a386665569554d88f2a3079 @henrik henrik committed Apr 16, 2009
Showing with 1 addition and 26 deletions.
  1. +1 −26 lib/jekyll/filters.rb
View
@@ -1,5 +1,3 @@
-require 'cgi'
-
module Jekyll
module Filters
@@ -19,41 +17,18 @@ def date_to_xmlschema(date)
date.xmlschema
end
- def time_to_string(date)
- date.strftime("%d %b %Y, %H:%M")
- end
-
def date_to_utc(date)
date.utc
end
- def url_escape(input)
- CGI.escape(input)
- end
-
def xml_escape(input)
- CGI.escapeHTML(input)
+ input.gsub("&", "&amp;").gsub("<", "&lt;").gsub(">", "&gt;")
end
def number_of_words(input)
input.split.length
end
- # Example:
- #
- # Posted in <span class="tags">{{ page.tags | tag_links: "example.com" }}</span>.
- #
- # Then style '.tags span { display: none; }' so the "tag:" bits don't show.
- # You can provide 'tags' as a YAML array in the post's front matter.
- def tag_links(array, domain)
- links = array.map { |tag|
- qs = %{site:#{domain} "tag: #{tag}"}
- url = "http://www.google.com/search?q=#{url_escape qs}"
- %{<a href="#{xml_escape url}"><span>tag:</span> #{xml_escape tag}</a>}
- }
- array_to_sentence_string(links)
- end
-
def array_to_sentence_string(array)
connector = "and"
case array.length

0 comments on commit c0e96dd

Please sign in to comment.