Skip to content

boilerplate.yml

The boilerplate.yml file is the configuration file at the root of every Boilerplate template. It defines variables, dependencies, hooks, skip rules, partials, and engine overrides.

required_version: ">= 0.5.0" # Optional version constraint
variables:
- name: MyVar
# ... variable definition
dependencies:
- name: my-dep
# ... dependency definition
hooks:
before:
- command: echo
args: ["Starting..."]
after:
- command: echo
args: ["Done!"]
partials:
- ../partials/*.html
skip_files:
- path: "*.test.go"
if: "{{ not .IncludeTests }}"
engines:
- path: "**/*.jsonnet"
template_engine: jsonnet

An optional version constraint (Terraform-style) that ensures the user is running a compatible version of Boilerplate:

required_version: ">= 0.5.0, < 1.0.0"

A list of variable definitions. See the Variables page for the full reference.

A list of child templates to process. See the Dependencies page for full details.

Shell commands to run before (before) or after (after) template rendering. See Hooks.

A list of glob patterns for external template files that can be included via Go’s {{ "{{" }} template "name" . {{ "}}" }} syntax:

partials:
- ../../partials/*.html
- ../shared/footer.html

Partials are defined in external files using {{ "{{" }} define "name" {{ "}}" }}...{{ "{{" }} end {{ "}}" }} and can be reused across multiple template files.

Rules for excluding files from the output. See Skip Files.

Override the template engine for specific files. Currently supports jsonnet as an alternative to the default Go template engine:

engines:
- path: "**/*.jsonnet"
template_engine: jsonnet

If a template directory doesn’t contain a boilerplate.yml, Boilerplate’s behavior depends on the --missing-config-action flag:

ValueBehavior
exit (default)Exit with an error
ignoreLog a warning and process files without variable substitution