Sha256: 016ffda4a0fab976af3069bdb71724f5ec95d8e73fea535568a13669ddd2ebc0
Contents?: true
Size: 821 Bytes
Versions: 8
Compression:
Stored size: 821 Bytes
Contents
class ComfortableMexicanSofa::Tag::Asset include ComfortableMexicanSofa::Tag def self.regex_tag_signature(identifier = nil) identifier ||= IDENTIFIER_REGEX /\{\{\s*cms:asset:(#{identifier}):?(.*?)\s*\}\}/ end def content return unless (layout = Comfy::Cms::Layout.find_by_identifier(identifier)) type = params[0] format = params[1] case type when 'css' out = "/cms-css/#{blockable.site.id}/#{identifier}/#{layout.cache_buster}.css" out = "<link href='#{out}' media='screen' rel='stylesheet' type='text/css' />" if format == 'html_tag' out when 'js' out = "/cms-js/#{blockable.site.id}/#{identifier}/#{layout.cache_buster}.js" out = "<script src='#{out}' type='text/javascript'></script>" if format == 'html_tag' out end end end
Version data entries
8 entries across 8 versions & 1 rubygems