mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-26 06:16:56 +09:00
Add go-source directive to repo pages
This makes Gogs repos work with godoc.org: https://github.com/golang/gddo/wiki/Source-Code-Links
This commit is contained in:
1 parent
102b675f96
commit
4323a89c03
3 files changed
+7
-1
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user