/nanoc-escaped-erubis

Erubis::EscapedEruby filter for Nanoc.

Primary LanguageRubyMIT LicenseMIT

Escaped Erubis filter for Nanoc.

A minor, but useful, modification of Nanoc's default Erubis filter, by Christopher Boone.

The Escaped Erubis filter works exactly like the regular Erubis filter, except that it uses Erubis::EscapedEruby in place of Erubis::Eruby. The EscapedEruby class switches the behavior of <%= %> and <%== %>, meaning that <%= %> escapes its contents and <%== %> does not. (The opposite of standard Erubis and Erb behavior.)

The Escaped Erubis filter also includes the ErboutEnhancer, which makes Eruby use _erbout as its buffer, in addition to its usual _buf. Thus filters and other code, such as those included with Nanoc, that assume you're using Erb, and that Erb is using _erbout, will work correctly when filtered with Escaped Erubis.

Installation

Just drop the filters folder into your project's /lib directory.

Or, if /lib/filters already exists, then add the escaped_erubis.rb file to it.

Usage

To filter an item with Escaped Erubis, use:

filter :escaped_erubis

To filter a layout, use something like this:

layout '*', :escaped_erubis

More information

Erubis

Nanoc filters

Nanoc