mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-29 20:13:27 +00:00
[feature] provide OwnerName
field for README template (#10981)
Co-Authored-By: 6543 <6543@obermui.de> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
parent
17837986f0
commit
b252b23f16
|
@ -236,7 +236,7 @@ Locales may change between versions, so keeping track of your customized locales
|
||||||
To add a custom Readme, add a markdown formatted file (without an `.md` extension) to `custom/options/readme`
|
To add a custom Readme, add a markdown formatted file (without an `.md` extension) to `custom/options/readme`
|
||||||
|
|
||||||
**NOTE:** readme templates support **variable expansion**.
|
**NOTE:** readme templates support **variable expansion**.
|
||||||
currently there are `{Name}` (name of repository), `{Description}`, `{CloneURL.SSH}` and `{CloneURL.HTTPS}`
|
currently there are `{Name}` (name of repository), `{Description}`, `{CloneURL.SSH}`, `{CloneURL.HTTPS}` and `{OwnerName}`
|
||||||
|
|
||||||
### Reactions
|
### Reactions
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,7 @@ func prepareRepoCommit(ctx models.DBContext, repo *models.Repository, tmpDir, re
|
||||||
"Description": repo.Description,
|
"Description": repo.Description,
|
||||||
"CloneURL.SSH": cloneLink.SSH,
|
"CloneURL.SSH": cloneLink.SSH,
|
||||||
"CloneURL.HTTPS": cloneLink.HTTPS,
|
"CloneURL.HTTPS": cloneLink.HTTPS,
|
||||||
|
"OwnerName": repo.OwnerName,
|
||||||
}
|
}
|
||||||
if err = ioutil.WriteFile(filepath.Join(tmpDir, "README.md"),
|
if err = ioutil.WriteFile(filepath.Join(tmpDir, "README.md"),
|
||||||
[]byte(com.Expand(string(data), match)), 0644); err != nil {
|
[]byte(com.Expand(string(data), match)), 0644); err != nil {
|
||||||
|
|
Loading…
Reference in a new issue