Sha256: a4f001f31060593e46e8011b0448e0527da85be104d870ccf7a3083368b77576
Contents?: true
Size: 854 Bytes
Versions: 15
Compression:
Stored size: 854 Bytes
Contents
# ERb renderer module Middleman module Renderers module ERb # Setup extension class << self # once registered def registered(app) app.before_configuration do template_extensions erb: :html end # After config app.after_configuration do ::Tilt.prefer(Template, :erb) end end alias_method :included, :registered end class Template < ::Tilt::ErubisTemplate ## # In preamble we need a flag `__in_erb_template` and SafeBuffer for padrino apps. # def precompiled_preamble(locals) original = super "__in_erb_template = true\n" << original # .rpartition("\n").first << "#{@outvar} = _buf = ActiveSupport::SafeBuffer.new\n" end end end end end
Version data entries
15 entries across 15 versions & 2 rubygems