lektor-render-template/README.md

19 lines
1.1 KiB
Markdown
Raw Normal View History

2023-02-05 01:10:09 +01:00
# lektor_render_template
2023-03-11 23:05:12 +01:00
This is a lektor plugin, that generates files based on a Jinja2 Template.
In this case it is expecting the [galaxy.svg](https://backwesen.de/l3d/ansible.l3d.space/src/branch/main/templates/galaxy.svg?display=source) Template and will geneate an optimzed Version of the SVG, using [scour](https://pypi.org/project/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:
```json
{'name': this.filename, 'state': this.colored_label, 'label': this.label_name, 'color': '#FF0000', 'suffix': 'fileend'} | svg
2023-03-11 23:05:12 +01:00
```
Note that ``name``, ``state`` and ``label`` are required keys, ``color`` and ``suffix`` are optional keys.
2023-03-11 23:05:12 +01:00
You can see a real life example of this plugin at [ansible.l3d.space](https://ansible.l3d.space/).
2023-02-05 01:10:09 +01:00
2023-03-04 03:17:09 +01:00
## Open Issues:
2023-03-11 23:05:12 +01:00
+ Currently the plugin does not support any config variable for template and variable choosing.
2023-03-04 03:17:09 +01:00
+ Currently the plugin generates the files in the assets dir.