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