lib/troy/helpers.rb in troy-0.0.23 vs lib/troy/helpers.rb in troy-0.0.24
- old
+ new
@@ -4,9 +4,17 @@
CGI.escapeHTML(content)
end
def partial(name, locals = {})
path = site.root.join("partials/_#{name}.erb")
- EmbeddedRuby.new(path.read, locals).render
+ EmbeddedRuby.new(path.read, locals.merge(site: site)).render
+ end
+
+ def inline_file(path)
+ site.root.join(path).read
+ end
+
+ def markdown(text)
+ Troy::Markdown.new(text).to_html
end
end
end