module Liquid::Filters
Public Instance Methods
img_tag(input, klass)
click to toggle source
# File lib/liquid/filters.rb, line 35 def img_tag(input, klass) %{<img src="#{input}" class="#{klass}" />} end
link_to_category(input)
click to toggle source
# File lib/liquid/filters.rb, line 47 def link_to_category(input) %{<a href="#{input[:url]}">#{input[:name]}</a>} end
link_to_news_item(input)
click to toggle source
# File lib/liquid/filters.rb, line 39 def link_to_news_item(input) %{<a href="/news/posts/first">#{input['title']}</a>} end
link_to_page(input)
click to toggle source
# File lib/liquid/filters.rb, line 43 def link_to_page(input) %{<a href="#{input['path']}">#{input['title']}</a>} end
link_to_roster_item(input)
click to toggle source
# File lib/liquid/filters.rb, line 51 def link_to_roster_item(input) %{<a href="#{input[:url]}">#{input[:name]}</a>} end
script_tag(input)
click to toggle source
# File lib/liquid/filters.rb, line 29 def script_tag(input) return '' if input.nil? %{<script src="/#{Limitedrun::Themekit::Config.javascripts_dir + "/" + input}" type="text/javascript"></script>} end
stylesheet_tag(input, media = 'screen')
click to toggle source
Extracted from locomotivecms/wagon Write the link to a stylesheet resource input: url of the css file
# File lib/liquid/filters.rb, line 21 def stylesheet_tag(input, media = 'screen') return '' if input.nil? input = stylesheet_url(input) %{<link href="#{input}" media="#{media}" rel="stylesheet" type="text/css" />} end
stylesheet_url(input)
click to toggle source
Extracted from locomotivecms/wagon Write the url of a theme stylesheet input: name of the css file
# File lib/liquid/filters.rb, line 6 def stylesheet_url(input) return '' if input.nil? if input =~ /^https?:/ input else input = "/stylesheets/#{input}" unless input =~ /^\// input = "#{input}.css" unless input[-4..-1] == '.css' input end end