Merge branch 'master' into 1786-replace-jekyll-with-zenweb
[arvados.git] / doc / zenweb-liquid.rb
1 require 'zenweb'
2
3 module ZenwebLiquid
4   VERSION = '0.0.1'
5 end
6
7 module Zenweb
8   class Page
9     
10     ##
11     # Render a page's liquid and return the intermediate result
12     def render_liquid page, content, binding = TOPLEVEL_BINDING
13       require 'liquid'
14       
15       unless defined? @liquid_template then
16         @liquid_template = Liquid::Template.parse(content).render()
17       end
18       
19       @liquid_template.render(binding)
20     end
21   end
22 end