lib/insightful/head_helper.rb in insightful-0.0.1.5 vs lib/insightful/head_helper.rb in insightful-0.0.1.6

- old
+ new

@@ -1,8 +1,25 @@ module Insightful module HeadHelper - + + def meta_for(post) + result = "" + unless post.title.blank? + result << title(post.title) + result << "\n" + end + unless post.tags.blank? + result << keywords(post.tags.join(", ")) + result << "\n" + end + unless post.description.blank? + result << description(post.description) + result << "\n" + end + result + end + def meta(options = {}) title(options[:title]) if options.has_key?(:title) description(options[:description]) if options.has_key?(:description) keywords(options[:keywords]) if options.has_key?(:keywords) copyright(options[:copyright]) if options.has_key?(:copyright) @@ -78,10 +95,10 @@ if title.blank? result = content_tag :title, site else title = normalize_title(title) title = [site] + title - title.reverse! if options[:reverse] === true + title.reverse! unless options[:reverse] === false sep = prefix + separator + suffix result = content_tag(:title, title.join(sep)) end result end \ No newline at end of file