Sha256: 5f7626d6f647c490baaecf2227272b55831c21bb6a5b1e357d57f726ed775c41
Contents?: true
Size: 626 Bytes
Versions: 47
Compression:
Stored size: 626 Bytes
Contents
# frozen_string_literal: false require 'temple' require 'hamlit/engine' require 'hamlit/helpers' # Load tilt/haml first to override if available begin require 'haml' rescue LoadError else require 'tilt/haml' end module Hamlit Template = Temple::Templates::Tilt.create( Hamlit::Engine, register_as: [:haml, :hamlit], ) module TemplateExtension # Activate Hamlit::Helpers for tilt templates. # https://github.com/judofyr/temple/blob/v0.7.6/lib/temple/mixins/template.rb#L7-L11 def compile(*) "extend Hamlit::Helpers; #{super}" end end Template.send(:extend, TemplateExtension) end
Version data entries
47 entries across 47 versions & 1 rubygems