backstage-nunjucks-replace
v0.1.3
Published
The nunjucks-config-replace backend module for the scaffolder plugin.
Downloads
38
Readme
backstage-nunjucks-replace
A Simple Plugin Module to create custom 'replacement' filters to use on the Backstage scaffolder. For example, accessing a private key from configuration in a step.
Usage
Add the following to your backstage config:
nunjucks-replace:
replacements:
- placeholder: <placeholder>
replacement: <replacementString>
...
If using the new backend system, you can add the module by simply placing this into your backend:
backend.add(import('backstage-nunjucks-replace'))
If using the old system, you will need to specify the config replacement in your scaffolder router like so:
return await createRouter({
...
additionalTemplateFilters: {
configReplace: configLookup(env.config)
}
})
You can then use the filter like so in your scaffolder actions:
${{ placeholder | configReplace }}