Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kenodegard committed May 6, 2024
1 parent 4893f38 commit fcf6c73
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,37 @@ Result:
Created by Maxi (@BetaHuhn)
```

By default, every Nunjucks template context will be pre-populated with the `repo` object containing the following values:

- `repo.url`
- `repo.fullName`
- `repo.uniqueName`
- `repo.host`
- `repo.user`
- `repo.name`
- `repo.branch`

This can be useful for certain bulk templating use cases:

```yml
# sync.yml

group:
- repos: |
user/repo1
user/repo2
...
files:
- source: src/README.md
template: true
```

```yml
# README.md

Hello from {{ repo.name }} by {{ repo.user }}!
```

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.

```yml
Expand Down

0 comments on commit fcf6c73

Please sign in to comment.