Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template context injection #17

Closed
pawamoy opened this issue Mar 21, 2020 · 0 comments
Closed

Template context injection #17

pawamoy opened this issue Mar 21, 2020 · 0 comments

Comments

@pawamoy
Copy link
Owner

pawamoy commented Mar 21, 2020

The user should be able to inject context variables into the templates. Maybe a mix of configuration files (/etc, /home/user (XDG compliant), and current directory locations), environment variables and command-line options.

pawamoy added a commit that referenced this issue Mar 23, 2024
Additional template variables for the Jinja template can be passed via CLI or can be defined in a configuration file.

To pass variables via CLI, the option `-j KEY=VALUE` or `--jinja-context KEY=VALUE` can be given multiple times.

To define variables in a configuration file, the variables can be defined in a "[jinja_context]"  table.

```toml
[jinja_context]
KEY = "VALUE"
```

All values are accessible in the template through the `jinja_context` (dict) variable.

Issue-17: #17
PR-73: #73
Co-authored-by: Timothée Mazzucotelli <dev@pawamoy.fr>
@pawamoy pawamoy closed this as completed Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant