Class HandlebarsTemplateCompilerConfig

java.lang.Object
com.mohamnag.jstatic.plugins.handlebars_template_compiler.HandlebarsTemplateCompilerConfig

public class HandlebarsTemplateCompilerConfig extends Object
Loads the configuration from "handlebars-template-compiler" key and expects following sub-keys:
  • "base-dir" pointing to templates' base, this path will be prepended to all other paths and every look up is restricted to be inside this path
  • "template-data-field" defines the name of the field under which each node of data tree can specify its own template to be used for template lookup
  • "default-template" defines the default template that will be used if a node does not specify its own
  • "target-data-field" the field's name under which the compilation result for each node of data tree will be stored
  • "helpers" list of helpers that should be registered. Each entry is either the full name of a Java plugin that should be present in classpath or a path to a JavaScript file that contains helpers' code.
  • "start-node" can be set to one node's path to restrict compilation to subsets of the data tree. The path should be set as a ordered list of keys that define the path.

For more details on the functionality see the docs on HandlebarsTemplateCompilerTask itself.