class Webgen::Context::HtmlHead::Proxy
Proxy object for working with the data structure needed by Webgen::ContentProcessor::HtmlHead.
Public Instance Methods
inline_fragment(type, content)
click to toggle source
Add inline CSS or JS fragments to the HTML head section.
The type can either be :css for a CSS fragment or :js for a javascript fragment.
# File lib/webgen/context/html_head.rb, line 44 def inline_fragment(type, content) type_check!(type) (cp_hash["#{type}_inline".intern] ||= []) << content end
link_file(type, file)
click to toggle source
Add a link to the given file in the HTML head section.
The type can either be :css for CSS files or :js for javascript files. The path to the file is resolved using the “relocatable” tag (see Webgen::Tag::Relocatable).
# File lib/webgen/context/html_head.rb, line 36 def link_file(type, file) type_check!(type) (cp_hash["#{type}_file".intern] ||= []) << @context.tag('relocatable', file) end
meta(name, content)
click to toggle source
Set the meta tag to the provided value.
Note that some meta information keys may not be specified multiple times!
# File lib/webgen/context/html_head.rb, line 21 def meta(name, content) (cp_hash[:meta] ||= {})[name] = content end
meta_property(name, content)
click to toggle source
Set the meta tag to the provided value, using property instead
of name.
Note that some meta information keys may not be specified multiple times!
# File lib/webgen/context/html_head.rb, line 28 def meta_property(name, content) (cp_hash[:meta_property] ||= {})[name] = content end