Sha256: 2e95c3b343ad6fe1a974af9b2bc6523f63dcff19194839d7f5b041f6b07e63a7
Contents?: true
Size: 1.14 KB
Versions: 1
Compression:
Stored size: 1.14 KB
Contents
--- title: Webgen::ContentProcessor::Erb --- > TODO: This needs to be redone {.exclamation} #### Evaluating ERB Tags TODO: ev move this to the ContentProcessor/Erb documentation??? The evaluation of ERB (embedded ruby) tags is optional and only done if the meta information `useERB` is set to `true`. The use of ERB allows to add dynamic content without using webgen tags. Following is an example of a file which uses ERB: <notextile> <pre> \--- title: Test page with ERB useERB: true \--- This page has the following meta info items: <% node.meta_info.each do |key, value| %> * <%=key %>: <%=value %> <% end %> </pre> </notextile> This would output all meta information for the file. There are some objects available which you can use in your ERB code: * `node`: the node for the current file (normally a page file) * `ref_node`: the reference node, i.e. the node in which the content will be embedded (normally a template file) *Caveat*: you may need to ensure that the ERB start and end tags are not processed by the content converter. For example, with Textile you may need to surround the ERB code with <textile> tags!
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
webgen-0.5.0 | doc/contentprocessor/erb.page |