https://github.com/bashkirtsevich/j2-render
Jinja2 template renderer
https://github.com/bashkirtsevich/j2-render
Last synced: 10 months ago
JSON representation
Jinja2 template renderer
- Host: GitHub
- URL: https://github.com/bashkirtsevich/j2-render
- Owner: bashkirtsevich
- Created: 2020-01-07T08:21:05.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-03-25T23:16:46.000Z (almost 5 years ago)
- Last Synced: 2025-01-23T00:08:42.861Z (12 months ago)
- Language: Python
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# J2 Renderer
Bulk template renderer based on Jinja2.
## Launch params
```
-h, --help show this help message and exit
-s SOURCE, --source=SOURCE
Valid path to template folder
-d DESTINATION, --destination=DESTINATION
Path to destination folder
-t TEMPLATE, --template=TEMPLATE
Filename of yml scenario in template folder
```
## Template file format
```yaml
css:
# Catch files in templates/css folder matches by mask `*`
src: templates/css/*
dst: css/
# This will work if any of environment variables is equal
when all:
$MODE: html
$STYLE: bootstrap
js:
src: templates/js/*
dst: js/
# This will work if all of environment variables is equal
when any:
$MODE: html
$STYLE: bootstrap
index:
src: templates/index.html
# Destination file name can contain environment variable reference
dst: $INDEX_OUT_NAME.html
env:
# Values to pass into Jinja2 template
title: "Index page"
sections: ["home", "about", "sitemap"]
```