Class: Jekyll::IncludeFile

Inherits:
Liquid::Tag
  • Object
show all
Defined in:
lib/ext.rb

Instance Method Summary collapse

Constructor Details

#initialize(tag_name, text, tokens) ⇒ IncludeFile

Returns a new instance of IncludeFile.



173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/ext.rb', line 173

def initialize(tag_name, text, tokens)
  rootPath0 = $g_config['include_file_path'] || 'assets'
  filePath0 = "#{rootPath0}/#{text}".strip()
  begin
    file = File.open(filePath0)
    @filecontent = file.read()
  rescue => exception
    puts exception
    @filecontent = "load file:#{text} failed"
    
  end
 
end

Instance Method Details

#render(context) ⇒ Object



187
188
189
# File 'lib/ext.rb', line 187

def render(context)
  return @filecontent
end