Sha256: 46a47f743c7a433a287a38c43ae7c996ce8bcc1fe779e675c3e38417f63d995d
Contents?: true
Size: 600 Bytes
Versions: 29
Compression:
Stored size: 600 Bytes
Contents
class Lalala::Markdown::Handlers::LazyAsset < Lalala::Markdown::Handlers::Base def initialize(options={}) @options = options end def image(url, alt=nil, title=nil) unless %r|^asset[:]//(.+)$| === url return "" end id_with_version = $1.split("/") id = id_with_version[0] version = id_with_version[1] # build url url = "//" + [ "c." + Haraway.configuration.endpoint, id, version ].compact.join("/") # build img element <<-EOS <img class="js-lazy" data-src="#{url}" alt="#{alt}" title="#{title}" /> EOS end end
Version data entries
29 entries across 29 versions & 1 rubygems