Skip to content

Commit fcf6c73

Browse files
committed
Update README.md
1 parent 4893f38 commit fcf6c73

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
@@ -236,6 +236,37 @@ Result:
236236
Created by Maxi (@BetaHuhn)
237237
```
238238

239+
By default, every Nunjucks template context will be pre-populated with the `repo` object containing the following values:
240+
241+
- `repo.url`
242+
- `repo.fullName`
243+
- `repo.uniqueName`
244+
- `repo.host`
245+
- `repo.user`
246+
- `repo.name`
247+
- `repo.branch`
248+
249+
This can be useful for certain bulk templating use cases:
250+
251+
```yml
252+
# sync.yml
253+
254+
group:
255+
- repos: |
256+
user/repo1
257+
user/repo2
258+
...
259+
files:
260+
- source: src/README.md
261+
template: true
262+
```
263+
264+
```yml
265+
# README.md
266+
267+
Hello from {{ repo.name }} by {{ repo.user }}!
268+
```
269+
239270
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.
240271

241272
```yml

0 commit comments

Comments
 (0)