Handlebars Support

Handlebars Support

Several fields in hermit.toml support Handlebars syntax for templating. This allows you to dynamically insert values into your configuration.

With Handlebars, you can access contextual information:

  • dir
    • this - The directory of the current hermit.toml file
    • hermit - The location of the .hermitgrab directory
    • home - The home of the user
    • xdg_config - The directory of XDG_CONFIG_HOME or its default
    • xdg_data - The directory of XDG_DATA_HOME or its default
    • xdg_state - The directory of XDG_STATE_HOME or its default
  • var - In an install action the variables as specified in the hermit.toml
    • name - The name of the install action
  • tag - The values of the detected tags as specified in tags
    • arch for example might be aarch64

The helper function snippet allows you to reference the contents of a defined snippet.