Class RawHandlebarsHelper
- java.lang.Object
-
- com.terminalfour.publish.handlebars.helper.BaseHelper
-
- com.terminalfour.publish.handlebars.helper.utility.RawHandlebarsHelper
-
- All Implemented Interfaces:
com.github.jknack.handlebars.Helper<Object>
@Component public class RawHandlebarsHelper extends BaseHelper
The {{#raw}} handlebars helper allows for the contents of the block to be output as-is, without any further processing.Usage
The {{#raw}} handlebars helper allows for the contents of the block to be output as-is, without any further processing.
This can be particularly useful when the block may contain handlebars expressions, but the developer wants them to be output as-is within the published page.
Example
{{#raw}} <p>The handlebars expression for the canonical URL of a page is {{canonicalURL}}.</p> {{/raw}}
In the above example, the contents of the raw block will be published directly within the page, without the {{canonicalURL}} handlebars expression being evaluated.
-
-
Constructor Summary
Constructors Constructor Description RawHandlebarsHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
apply(Object context, com.github.jknack.handlebars.Options options)
Theapply
method is the main entry point for handlebars.java helpers.
-
-
-
Method Detail
-
apply
public String apply(Object context, com.github.jknack.handlebars.Options options)
Description copied from class:BaseHelper
Theapply
method is the main entry point for handlebars.java helpers.It is called internally by the handlebars.java engine when a matching handlebars.java expression is encountered.
- Specified by:
apply
in interfacecom.github.jknack.handlebars.Helper<Object>
- Specified by:
apply
in classBaseHelper
- Parameters:
context
- The currently executing context.options
- The options.- Returns:
- The generated output.
-
-