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
@@ -234,6 +234,37 @@ Result:
234
234
Created by Maxi (@BetaHuhn)
235
235
```
236
236
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
+
237
268
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