makeshift/pkg/plugins/jinja2
2025-09-20 15:35:39 -06:00
..
jinja2.go refactor: updated plugin implementations 2025-09-20 15:35:39 -06:00
README.md chore: added individual READMEs to default plugins 2025-08-31 22:54:18 -06:00

Makeshift Jinja 2 Plugin

This is a makeshift plugin that allows rendering files with Jinja 2 grammar. The plugin reads from a storage.KVStore passed to the Run() function and substitute the values in files provided with key file. Profiles can also be used to inject data into the store as well.

Compile the plugin if not done already.

makeshift compile pkg/plugins/jinja2/jinja2.go -o $MAKESHIFT_ROOT/plugins/jinja.so

Then, try download a file that contains Jinja2 variables. The makeshift server includes a help.txt and default.json profile to show how rendering can be done with downloads, profiles, and plugins.

First, try downloading the help.txt file without rendering.

makeshift download -p help.txt

Notice that there are Jinja2 variables with no substitutions done here. Now, try it again with the jinja2 plugin and the default profile.

makeshift download -p help.txt --plugins jinja2 --profile default

You should see the same file, but now the values are populated with the content stored in the profile. Remember...the data can also be populated using other plugins as well (see the smd plugin regarding this).

Also, keep in mind that rendering happens across directories as well.

makeshift download -p templates --plugins jinja2 --profile
default

This will render all Jinja 2 templates before archiving and downloading the files with the client.