diff options
author | 无闻 <u@gogs.io> | 2015-10-31 11:45:40 -0400 |
---|---|---|
committer | 无闻 <u@gogs.io> | 2015-10-31 11:45:40 -0400 |
commit | 659bd29bc5d5ef6142f348bd6899744350743da9 (patch) | |
tree | f50a256a11ebd1ec3ef887aa3de4ac67f5c142b5 /modules | |
parent | 91c9069c4d674615a306cc7d5317aae03eecb002 (diff) | |
parent | 4323a89c0354e4f25dbffc4b77c1e3f9ba68ba24 (diff) | |
download | gitea-659bd29bc5d5ef6142f348bd6899744350743da9.tar.gz gitea-659bd29bc5d5ef6142f348bd6899744350743da9.zip |
Merge pull request #1863 from nathan7/go-source-meta
Add go-source directive to repo pages
Diffstat (limited to 'modules')
-rw-r--r-- | modules/middleware/repo.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go index ba7cbac821..6424018a20 100644 --- a/modules/middleware/repo.go +++ b/modules/middleware/repo.go @@ -347,6 +347,8 @@ func RepoAssignment(redirect bool, args ...bool) macaron.Handler { if ctx.Query("go-get") == "1" { ctx.Data["GoGetImport"] = fmt.Sprintf("%s/%s/%s", setting.Domain, u.Name, repo.Name) + ctx.Data["GoDocDirectory"] = fmt.Sprintf("%s%s/%s/src/master{/dir}", setting.AppUrl, repo.Owner.LowerName, repo.LowerName) + ctx.Data["GoDocFile"] = fmt.Sprintf("%s%s/%s/src/master{/dir}/{file}#L{line}", setting.AppUrl, repo.Owner.LowerName, repo.LowerName) } if ctx.IsSigned { |