mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-05 04:29:47 +00:00
adding ability to use variables from the config file in templates
This commit is contained in:
24
README.md
24
README.md
@@ -547,16 +547,21 @@ the following entries:
|
||||
- ...
|
||||
```
|
||||
|
||||
* **actions** entry: a list of action
|
||||
* **actions** entry: a list of action (see [Use actions](#use-actions))
|
||||
```
|
||||
<action-key>: <command-to-execute>
|
||||
```
|
||||
|
||||
* **trans** entry: a list of transformations
|
||||
* **trans** entry: a list of transformations (see [Use transformations](#use-transformations))
|
||||
```
|
||||
<trans-key>: <command-to-execute>
|
||||
```
|
||||
|
||||
* **variables** entry: a list of template variables
|
||||
```
|
||||
<variable-name>: <variable-content>
|
||||
```
|
||||
|
||||
## All dotfiles for a profile
|
||||
|
||||
To use all defined dotfiles for a profile, simply use
|
||||
@@ -621,6 +626,21 @@ Note that dotdrop uses different delimiters than
|
||||
* `{{@@ env['MY_VAR'] @@}}` contains environment variables (see [Environment variables](#environment-variables)).
|
||||
* `{{@@ header @@}}` insert dotdrop header (see [Dotdrop header](#dotdrop-header)).
|
||||
|
||||
Addionally to the above, variables can be added in the config yaml file under
|
||||
the `variables` entry. The variables added there are directly reachable in
|
||||
any templates.
|
||||
|
||||
For example in the config file:
|
||||
```yaml
|
||||
variables:
|
||||
var1: some variable content
|
||||
```
|
||||
|
||||
Those can then be used in any template with
|
||||
```
|
||||
{{@@ var1 @@}}
|
||||
```
|
||||
|
||||
## Dotdrop header
|
||||
|
||||
Dotdrop is able to insert a header in the generated dotfiles. This allows
|
||||
|
||||
Reference in New Issue
Block a user