Skip to content

Commit ba70ac4

Browse files
committed
Update README.md
1 parent 7967584 commit ba70ac4

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,37 @@ Result:
234234
Created by Maxi (@BetaHuhn)
235235
```
236236

237+
By default, every Nunjucks template context will be pre-populated with the `repo` object containing the following values:
238+
239+
- `repo.url`
240+
- `repo.fullName`
241+
- `repo.uniqueName`
242+
- `repo.host`
243+
- `repo.user`
244+
- `repo.name`
245+
- `repo.branch`
246+
247+
This can be useful for certain bulk templating use cases:
248+
249+
```yml
250+
# sync.yml
251+
252+
group:
253+
- repos: |
254+
user/repo1
255+
user/repo2
256+
...
257+
files:
258+
- source: src/README.md
259+
template: true
260+
```
261+
262+
```yml
263+
# README.md
264+
265+
Hello from {{ repo.name }} by {{ repo.user }}!
266+
```
267+
237268
You can also use `extends` with a relative path to inherit other templates. Take a look at Nunjucks [template syntax](https://mozilla.github.io/nunjucks/templating.html) for more info.
238269

239270
```yml

0 commit comments

Comments
 (0)