lib/staticpress/view_helpers.rb in staticpress-0.6.0 vs lib/staticpress/view_helpers.rb in staticpress-0.6.1
- old
+ new
@@ -13,18 +13,26 @@
include Staticpress::Plugins.const_get(plugin)
end
end
end
- # TODO site_meta should be an aggregate all metadata
- def site_meta
- end
-
def partial(name, locals = {})
template_name = theme.include_for name
if template_name.file?
template = Tilt[template_name].new { template_name.read }
template.render self.class.new(page), locals
end
+ end
+
+ # TODO site_meta should be an aggregate all metadata
+ def site_meta
+ end
+
+ def tag(name, attributes = {}, &block)
+ attribute_string = attributes.map do |key, value|
+ " #{key}=\"#{value}\""
+ end.join('')
+ content = block_given? ? block.call : ''
+ "<#{name}#{attribute_string}>#{content}</#{name}>"
end
end
end