class Pakman::LiquidPageTemplate
convenience helper for pages (with headers/front matter)
Public Class Methods
from_file( path )
click to toggle source
# File lib/pakman/liquid/template.rb, line 45 def self.from_file( path ) ## todo: (auto)-add headers as page.title etc. -- why? why not?? puts " Loading page template (from file) >#{path}<..." page = Page.from_file( path ) ## use/todo: use read utf8 - why? why not?? self.new( page.contents, path: path ) ## note: pass along path as an option end
from_string( text )
click to toggle source
# File lib/pakman/liquid/template.rb, line 52 def self.from_string( text ) ### use parse as alias - why?? why not?? ## todo: (auto)-add headers as page.title etc. -- why? why not?? page = Page.from_string( text ) self.new( page.contents ) end
new( text, opts={} )
click to toggle source
# File lib/pakman/liquid/template.rb, line 58 def initialize( text, opts={} ) @template = LiquidTemplate.new( text, opts ) end
Public Instance Methods
render( hash )
click to toggle source
# File lib/pakman/liquid/template.rb, line 62 def render( hash ) @template.render( hash ) end