Class: Hx::Output::LiquidTemplate::TemplateSource
- Inherits:
-
Object
- Object
- Hx::Output::LiquidTemplate::TemplateSource
- Includes:
- Filter
- Defined in:
- lib/hx/output/liquidtemplate.rb
Instance Method Summary collapse
- #each_entry_path(selector) ⇒ Object
- #get_entry(path) ⇒ Object
-
#initialize(options) ⇒ TemplateSource
constructor
A new instance of TemplateSource.
Methods included from Filter
Methods included from View
Constructor Details
#initialize(options) ⇒ TemplateSource
Returns a new instance of TemplateSource.
66 67 68 69 70 71 72 |
# File 'lib/hx/output/liquidtemplate.rb', line 66 def initialize() # global, so all LiquidTemplate instances have to agree on the # same template directory for things to work right @template_dir = Hx.get_pathname(, :template_dir) Liquid::Template.file_system = Liquid::LocalFileSystem.new(@template_dir) Liquid::Template.register_filter(TextFilters) end |
Instance Method Details
#each_entry_path(selector) ⇒ Object
74 75 76 77 |
# File 'lib/hx/output/liquidtemplate.rb', line 74 def each_entry_path(selector) # enumeration currently unneeded self end |
#get_entry(path) ⇒ Object
79 80 81 82 |
# File 'lib/hx/output/liquidtemplate.rb', line 79 def get_entry(path) template_file = @template_dir + "#{path}.liquid" {"template" => Liquid::Template.parse(template_file.read)} end |