Lektor Plugin to Render Files based on templates
Find a file
2023-07-31 16:25:52 +02:00
.gitignore initialize git repo 2023-02-05 01:10:09 +01:00
lektor_render_template.py Update render Template with aditional parts 2023-03-22 00:52:11 +01:00
LICENSE initialize git repo 2023-02-05 01:10:09 +01:00
README.md Change git repo fqdn 2023-07-31 16:25:52 +02:00
setup.py Change git repo fqdn 2023-07-31 16:25:52 +02:00

lektor_render_template

This is a lektor plugin, that generates files based on a Jinja2 Template.

In this case it is expecting the galaxy.svg Template and will geneate an optimzed Version of the SVG, using scour. We take a dict as input with the values name to generate the output file name, label to affect the filename too and is used as first text in the svg and state text in the svg with colored background.

Example Usage:

{'name': this.filename, 'state': this.colored_label, 'label': this.label_name, 'color': '#FF0000', 'suffix': 'fileend'} | svg

Note that name, state and label are required keys, color and suffix are optional keys.

You can see a real life example of this plugin at ansible.l3d.space.

Open Issues:

  • Currently the plugin does not support any config variable for template and variable choosing.
  • Currently the plugin generates the files in the assets dir.