0.1.3 • Published 1 year ago

backstage-nunjucks-replace v0.1.3

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year ago

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 }}