module Webgen::ContentProcessor::HtmlHead
General information¶ ↑
Inserts additional links to CSS/JS files and other HTML head meta info directly before the HTML head end tag.
The data used by this content processor is taken from the Context object. Therefore this processor should be the last in the processing pipeline so that all other processors have been able to set the data.
Use the methods defined on the special Webgen::Context::HtmlHead::Proxy
object which can be accessed via Webgen::Context#html_head
to provide values.
Internal details¶ ↑
The key :cp_html_head
of context.persistent
is used (the normal context.options
won't do because the data needs to be shared 'backwards' during the rendering) and it has to be a Hash
with the following values:
- :js_file
-
An array of already resolved relative or absolute paths to Javascript files.
- :js_inline
-
An array of Javascript fragments to be inserted directly into the head section.
- :css_file
-
An array of already resolved relative or absolute paths to CSS files.
- :css_inline
-
An array of CSS fragments to be inserted directly into the head section.
- :meta
-
A hash with key-value pairs from which 'meta' tags are generated. The keys and the values will be properly escaped before insertion. The entries in the meta information 'meta' of the content node are also used and take precedence over these entries.
Duplicate values will be removed from the above mentioned arrays before generating the output.
Public Class Methods
Insert the additional header information.
Return a string containing HTML link tags to the links from the 'link' meta information.
Return a string containing HTML link tags to translations of the destination node.
Yield the values of the specified array.
Given an array of path names, add tracker information for the resolved nodes (reference node is the content node) and return the relative paths to them.