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
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