You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -236,6 +236,37 @@ Result:
236
236
Created by Maxi (@BetaHuhn)
237
237
```
238
238
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
+
239
270
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.
0 commit comments