diff --git a/models/repo.go b/models/repo.go index 3f631b6984..eff66254f0 100644 --- a/models/repo.go +++ b/models/repo.go @@ -326,6 +326,11 @@ func (repo *Repository) RepoLink() string { return setting.AppSubUrl + "/" + repo.MustOwner().Name + "/" + repo.Name } +func (repo *Repository) RepoRelLink() string { + return "/" + repo.MustOwner().Name + "/" + repo.Name +} + + func (repo *Repository) ComposeCompareURL(oldCommitID, newCommitID string) string { return fmt.Sprintf("%s/%s/compare/%s...%s", repo.MustOwner().Name, repo.Name, oldCommitID, newCommitID) } diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index 34ef9fafa1..2bae961dae 100644 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -10,7 +10,7 @@